ams_c.h
Go to the documentation of this file.
1 /**
2  ****************************************************************************************
3  *
4  * @file AMS_c.h
5  *
6  * @brief Apple Media Service Client API.
7  *
8  ****************************************************************************************
9  * @attention
10  #####Copyright (c) 2019 GOODIX
11  All rights reserved.
12 
13  Redistribution and use in source and binary forms, with or without
14  modification, are permitted provided that the following conditions are met:
15  * Redistributions of source code must retain the above copyright
16  notice, this list of conditions and the following disclaimer.
17  * Redistributions in binary form must reproduce the above copyright
18  notice, this list of conditions and the following disclaimer in the
19  documentation and/or other materials provided with the distribution.
20  * Neither the name of GOODIX nor the names of its contributors may be used
21  to endorse or promote products derived from this software without
22  specific prior written permission.
23 
24  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27  ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
28  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  POSSIBILITY OF SUCH DAMAGE.
35  *****************************************************************************************
36  */
37 /**
38  * @addtogroup BLE_SRV BLE Services
39  * @{
40  */
41 
42 /**
43  * @defgroup BLE_SDK_AMS_C Apple Media Service Client (AMS_C)
44  * @{
45  * @brief Apple Media Service Client module.
46  *
47  * @details The Apple Media Service Client contains the APIs and types, which can be used
48  * by the application to discover Apple Media Service of peer and interact with it.
49  *
50  * The application must provide an event handler to be registered, then call \ref ams_c_client_init() to initialize the client.
51  * After the application discovers peer Apple Media Service by calling \ref ams_c_disc_srvc_start(),
52  * application can call \ref ams_c_cmd_send() to send romote command to peer and \ref ams_c_attr_focus_set to
53  * set the attribute focus.
54  *
55  * Secondly, use \ref ams_c_cmd_notify_set() and \ref ams_c_attr_update_notify_set() to enable the notification
56  * for CMD update and attribute update.
57  *
58  * When the available CMDs or concerned attributes change, the module will receive notification from peer
59  * if notifications of them are enabled. If the notification containing the information of changed attribute
60  * is truncated, application can call \ref ams_c_attr_display_set to set the attribute that needs to be completely
61  * displayed and \ref ams_c_cplt_attr_read to get the completely information of the attribute.
62 
63  */
64 
65 #ifndef __AMS_C_H__
66 #define __AMS_C_H__
67 
68 #include "gr55xx_sys.h"
69 #include "ble_prf_types.h"
70 #include "custom_config.h"
71 
72 /**
73  * @defgroup AMS_C_MACRO Defines
74  * @{
75  */
76 #define AMS_C_CONNECTION_MAX (10 < CFG_MAX_CONNECTIONS ?\
77  10 : CFG_MAX_CONNECTIONS) /**< Maximum number of HRS Client connections. */
78 #define AMS_C_ATTR_COUNT_MAX 256 /**< The buffer size of command. */
79 #define AMS_C_TRUNCATED_FLAG (0x01<<0) /**< Bit of truncated. */
80 #define AMS_SRVC_UUID 0xdc, 0xf8, 0x55, 0xad, 0x02, 0xc5, 0xf4, 0x8e,\
81  0x3a, 0x43, 0x36, 0x0f, 0x2b, 0x50, 0xd3, 0x89 /**< UUID of Apple media service. */
82 #define AMS_CMD_UUID 0xc2, 0x51, 0xca, 0xf7, 0x56, 0x0e, 0xdf, 0xb8,\
83  0x8a, 0x4a, 0xb1, 0x57, 0xd8, 0x81, 0x3c, 0x9b /**< UUID of remote command. */
84 #define AMS_ATTR_UPDATE_UUID 0x02, 0xC1, 0x96, 0xBA, 0x92, 0xBB, 0x0C, 0x9A,\
85  0x1F, 0x41, 0x8D, 0x80, 0xCE, 0xAB, 0x7C, 0x2F /**< UUID of attribute update. */
86 #define AMS_ATTR_DISPLAY_UUID 0xd7, 0xd5, 0xbb, 0x70, 0xa8, 0xa3, 0xab, 0xa6,\
87  0xd8, 0x46, 0xab, 0x23, 0x8c, 0xf3, 0xb2, 0xc6 /**< UUID of attribute display. */
88 /** @} */
89 
90 /**
91  * @defgroup AMS_C_ENUM Enumerations
92  * @{
93  */
94 
95 /**@brief Apple Media Service Command ID. */
96 typedef enum
97 {
98  AMS_CMD_ID_PLAY, /**< Command index of play. */
99  AMS_CMD_ID_PAUSE, /**< Command index of pause. */
100  AMS_CMD_ID_TOGGLE_PLAY_PAUSE, /**< Command index of toggle. */
101  AMS_CMD_ID_NEXT_TRACK, /**< Command index of next track. */
102  AMS_CMD_ID_PREVIOUS_TRACK, /**< Command index of previous track. */
103  AMS_CMD_ID_VOLUME_UP, /**< Command index of volume up. */
104  AMS_CMD_ID_VOLUME_DOWN, /**< Command index of volume down. */
105  AMS_CMD_ID_ADVANCE_REPEAT_MODE, /**< Command index of repeat mode. */
106  AMS_CMD_ID_ADVANCE_SHUFFLE_MODE, /**< Command index of shuffle mode. */
107  AMS_CMD_ID_SKIP_FORWARD, /**< Command index of skip forward. */
108  AMS_CMD_ID_SKIP_BACKWARD, /**< Command index of skip backward. */
109  AMS_CMD_ID_LIKE_TRACK, /**< Command index of like track. */
110  AMS_CMD_ID_DISLIKE_TRACK, /**< Command index of dislike track. */
111  AMS_CMD_ID_BOOK_MARK_TRACK, /**< ComMand index of book mark. */
113 
114 /**@brief Apple Media Service entities index. */
115 typedef enum
116 {
117  AMS_ETT_ID_PLAYER, /**< Entity index of player. */
118  AMS_ETT_ID_QUEUE, /**< Entity index of queue. */
119  AMS_ETT_ID_TRACK, /**< Entity index of track. */
121 
122 /**@brief Apple Media Service player attribute index. */
123 enum
124 {
125  AMS_PLAYER_ATTR_ID_NAME, /**< Player attribute index of name. */
126  AMS_PLAYER_ATTR_ID_PLAYBACK_INFO, /**< Player attribute index of playback information. */
127  AMS_PLAYER_ATTR_ID_VOLUME, /**< Player attribute index of volume. */
128 };
129 
130 /**@brief Apple Media Service queue attribute index. */
131 enum
132 {
133  AMS_QUEUE_ATTR_ID_INDEX, /**< Queue attribute index of index. */
134  AMS_QUEUE_ATTR_ID_COUNT, /**< Queue attribute index of count. */
135  AMS_QUEUE_ATTR_ID_SHUFFLE_MODE, /**< Queue attribute index of shuffle mode. */
136  AMS_QUEUE_ATTR_ID_REPEAT_MODE, /**< Queue attribute index of repeat mode. */
137 };
138 
139 /**@brief Apple Media Service track attribute index. */
140 enum
141 {
142  AMS_TRACK_ATTR_ID_ARTIST, /**< Track attribute index of artist. */
143  AMS_TRACK_ATTR_ID_ALBUM, /**< Track attribute index of album. */
144  AMS_TRACK_ATTR_ID_TITTLE, /**< Track attribute index of tittle. */
145  AMS_TRACK_ATTR_ID_DURATION, /**< Track attribute index of duration. */
146 };
147 
148 /**@brief Apple Media Service Client Event type. */
149 typedef enum
150 {
151  AMS_C_EVT_INVALID, /**< AMS Client invalid event type. */
152  AMS_C_EVT_DISCOVERY_CPLT, /**< AMS Client has found AMS service and its characteristics. */
153  AMS_C_EVT_DISCOVERY_FAIL, /**< AMS Client found AMS service failed because of invalid operation or no found at the peer. */
154  AMS_C_EVT_CMD_SEND_SUCCESS, /**< AMS Client has sent command. */
155  AMS_C_EVT_CMD_UPDATE_RECEIVE, /**< AMS Client has recieved updated command list. */
156  AMS_C_EVT_CMD_UPDATE_NTF_SET_SUCCESS, /**< AMS Client has set command update notification. */
157  AMS_C_EVT_ATTR_FOCUS_SET_SUCCESS, /**< AMS Client has set focus attribute */
158  AMS_C_EVT_ATTR_UPDATE_RECEIVE, /**< AMS Client has received updated attribution data. */
159  AMS_C_EVT_ATTR_UPDATE_NTF_SET_SUCCESS, /**< AMS Client has set focus attribute notification. */
160  AMS_C_EVT_CPLT_ATTR_DISPLAY_SET_SUCCESS, /**< AMS Client has set the attribute which needs to be completely displayed. */
161  AMS_C_EVT_CPLT_ATTR_READ_RSP, /**< AMS Client has received a read response. */
162  AMS_C_EVT_WRITE_OP_ERR, /**< Write error. */
164 /** @} */
165 
166 /**
167  * @defgroup AMS_C_STRUCT Structures
168  * @{
169  */
170 
171 /**@brief Structure that stores the attribute to be concerned or to display completely. */
172 typedef struct
173 {
174  ams_c_ett_id_t ett_id; /**< Entity index. */
175  uint8_t attr_id[AMS_C_ATTR_COUNT_MAX]; /**< Attribute indexs. */
176  uint16_t attr_count; /**< Count of attribute. */
178 
179 /**@brief Structure that stores new command list. */
180 typedef struct
181 {
182  ams_c_cmd_id_t *p_cmd; /**< Command list. */
183  uint16_t length; /**< Count of Command. */
185 
186 /**@brief Structure that stores attribute information. */
187 typedef struct
188 {
189  ams_c_ett_id_t ett_id; /**< Entity index. */
190  uint8_t attr_id; /**< Attribute index. */
191  uint8_t flag; /**< Flag about attribute. */
192  uint8_t *p_data; /**< Attribute data. */
193  uint16_t length; /**< Length of attribute data. */
195 
196 /**@brief Complete attribution's value . */
197 typedef struct
198 {
199  uint8_t *p_data; /**< complete attribute data. */
200  uint16_t length; /**< Length of complete attribute data. */
202 
203 /**@brief Handles on the connected peer device needed to interact with it. */
204 typedef struct
205 {
206  uint16_t ams_srvc_start_handle; /**< AMS Service start handle. */
207  uint16_t ams_srvc_end_handle; /**< AMS Service end handle. */
208  uint16_t ams_cmd_handle; /**< AMS Service remote command handle. */
209  uint16_t ams_cmd_cccd_handle; /**< AMS Service remote command cccd handle. */
210  uint16_t ams_attr_update_handle; /**< AMS Service update attribute handle. */
211  uint16_t ams_attr_update_cccd_handle; /**< AMS Service update attribute cccd handle. */
212  uint16_t ams_attr_display_handle; /**< AMS Service complete attribute display handle. */
214 
215 /**@brief Apple Media Service Client event. */
216 typedef struct
217 {
218  uint8_t conn_idx; /**< The index of the connection. */
219  ams_c_evt_type_t evt_type; /**< The AMS event type. */
220  union
221  {
222  ams_c_cmd_list_t cmd_list; /**< Command list. */
223  ams_c_attr_info_t attr_info; /**< Attribute information. */
224  ams_c_cplt_attr_data_t cplt_attr_data; /**< Complete attribute data. */
225  } param; /**< Data received. */
226 } ams_c_evt_t;
227 /** @} */
228 
229 /**
230  * @defgroup AMS_C_TYPEDEF Typedefs
231  * @{
232  */
233 /**@brief Apple Media Service Client event handler type.*/
234 typedef void (*ams_c_evt_handler_t)(ams_c_evt_t *p_evt);
235 /** @} */
236 
237 /**
238  * @defgroup AMS_FUNCTION Functions
239  * @{
240  */
241 
242 /**
243  *****************************************************************************************
244  * @brief Register AMS Client event handler.
245  *
246  * @param[in] evt_handler: Apple Media Service Client event handler.
247  *
248  * @return Result of initialization.
249  *****************************************************************************************
250  */
252 
253 /**
254  *****************************************************************************************
255  * @brief Discover Apple Media Service on peer.
256  *
257  * @param[in] conn_idx: Index of connection.
258  *
259  * @return Operation result.
260  *****************************************************************************************
261  */
263 
264 /**
265  *****************************************************************************************
266  * @brief Enable or disable peer new command list notify.
267  *
268  * @param[in] conn_idx: Index of connection.
269  * @param[in] is_enable: True for turn on, false for turn off.
270  *
271  * @return Operation result.
272  *****************************************************************************************
273  */
274 sdk_err_t ams_c_cmd_notify_set(uint8_t conn_idx, bool is_enable);
275 
276 /**
277  *****************************************************************************************
278  * @brief Enable or disable peer updated attribute notify.
279  *
280  * @param[in] conn_idx: Index of connection.
281  * @param[in] is_enable: True for turn on, false for turn off.
282  *
283  * @return Operation result.
284  *****************************************************************************************
285  */
286 sdk_err_t ams_c_attr_update_notify_set(uint8_t conn_idx, bool is_enable);
287 
288 /**
289  *****************************************************************************************
290  * @brief Read complete value of updated attrbute .
291  *
292  * @param[in] conn_idx: Index of connection.
293  *
294  * @return Operation result.
295  *****************************************************************************************
296 */
297 sdk_err_t ams_c_cplt_attr_read(uint8_t conn_idx);
298 
299 /**
300  *****************************************************************************************
301  * @brief Send command to peer device.
302  *
303  * @param[in] conn_idx: Index of connection.
304  * @param[in] cmd_id: Index of command.
305 *
306  * @return Operation result.
307  *****************************************************************************************
308 */
309 sdk_err_t ams_c_cmd_send(uint8_t conn_idx, uint8_t cmd_id);
310 
311 /**
312  *****************************************************************************************
313  * @brief Set concerned attribute.
314  *
315  * @param[in] conn_idx: Index of connection.
316  * @param[in] p_ett_attr_id: Point to the structure containing concerned attribute
317 *
318  * @return Operation result.
319  *****************************************************************************************
320 */
321 sdk_err_t ams_c_attr_focus_set(uint8_t conn_idx, const ams_c_ett_attr_id_t *p_ett_attr_id);
322 
323 /**
324  *****************************************************************************************
325  * @brief Set the attribute that needs to be completely displayed.
326  *
327  * @param[in] conn_idx: Index of connection.
328  * @param[in] p_attr_info: Point to the structure containing concerned attribute
329 *
330  * @return Operation result.
331  *****************************************************************************************
332 */
333 sdk_err_t ams_c_attr_display_set(uint8_t conn_idx, const ams_c_attr_info_t *p_attr_info);
334 
335 /**
336  *****************************************************************************************
337  * @brief Check if the command is available.
338  *
339  * @param[in] cmd_id: Index of command.
340 *
341  * @return Operation result.
342  *****************************************************************************************
343 */
345 /** @} */
346 
347 #endif
348 /** @} */
349 /** @} */
AMS_C_EVT_INVALID
@ AMS_C_EVT_INVALID
AMS Client invalid event type.
Definition: ams_c.h:151
ams_c_cmd_send
sdk_err_t ams_c_cmd_send(uint8_t conn_idx, uint8_t cmd_id)
Send command to peer device.
AMS_C_EVT_DISCOVERY_FAIL
@ AMS_C_EVT_DISCOVERY_FAIL
AMS Client found AMS service failed because of invalid operation or no found at the peer.
Definition: ams_c.h:153
ams_c_cmd_enable_check
bool ams_c_cmd_enable_check(ams_c_cmd_id_t cmd_id)
Check if the command is available.
ams_c_cmd_list_t
Structure that stores new command list.
Definition: ams_c.h:181
ams_c_evt_t::attr_info
ams_c_attr_info_t attr_info
Attribute information.
Definition: ams_c.h:223
ams_c_handles_t
Handles on the connected peer device needed to interact with it.
Definition: ams_c.h:205
AMS_CMD_ID_BOOK_MARK_TRACK
@ AMS_CMD_ID_BOOK_MARK_TRACK
ComMand index of book mark.
Definition: ams_c.h:111
ams_c_disc_srvc_start
sdk_err_t ams_c_disc_srvc_start(uint8_t conn_idx)
Discover Apple Media Service on peer.
ams_c_evt_type_t
ams_c_evt_type_t
Apple Media Service Client Event type.
Definition: ams_c.h:150
AMS_CMD_ID_VOLUME_UP
@ AMS_CMD_ID_VOLUME_UP
Command index of volume up.
Definition: ams_c.h:103
ams_c_handles_t::ams_cmd_handle
uint16_t ams_cmd_handle
AMS Service remote command handle.
Definition: ams_c.h:208
AMS_CMD_ID_SKIP_FORWARD
@ AMS_CMD_ID_SKIP_FORWARD
Command index of skip forward.
Definition: ams_c.h:107
AMS_ETT_ID_QUEUE
@ AMS_ETT_ID_QUEUE
Entity index of queue.
Definition: ams_c.h:118
ams_c_handles_t::ams_srvc_start_handle
uint16_t ams_srvc_start_handle
AMS Service start handle.
Definition: ams_c.h:206
ams_c_evt_t::cplt_attr_data
ams_c_cplt_attr_data_t cplt_attr_data
Complete attribute data.
Definition: ams_c.h:224
AMS_CMD_ID_PAUSE
@ AMS_CMD_ID_PAUSE
Command index of pause.
Definition: ams_c.h:99
AMS_CMD_ID_SKIP_BACKWARD
@ AMS_CMD_ID_SKIP_BACKWARD
Command index of skip backward.
Definition: ams_c.h:108
AMS_TRACK_ATTR_ID_TITTLE
@ AMS_TRACK_ATTR_ID_TITTLE
Track attribute index of tittle.
Definition: ams_c.h:144
ams_c_handles_t::ams_attr_update_handle
uint16_t ams_attr_update_handle
AMS Service update attribute handle.
Definition: ams_c.h:210
ams_c_ett_attr_id_t::attr_count
uint16_t attr_count
Count of attribute.
Definition: ams_c.h:176
AMS_QUEUE_ATTR_ID_INDEX
@ AMS_QUEUE_ATTR_ID_INDEX
Queue attribute index of index.
Definition: ams_c.h:133
ams_c_ett_attr_id_t::ett_id
ams_c_ett_id_t ett_id
Entity index.
Definition: ams_c.h:174
ams_c_attr_info_t::attr_id
uint8_t attr_id
Attribute index.
Definition: ams_c.h:190
AMS_TRACK_ATTR_ID_DURATION
@ AMS_TRACK_ATTR_ID_DURATION
Track attribute index of duration.
Definition: ams_c.h:145
gr55xx_sys.h
GR55XX System API.
ams_c_attr_update_notify_set
sdk_err_t ams_c_attr_update_notify_set(uint8_t conn_idx, bool is_enable)
Enable or disable peer updated attribute notify.
AMS_QUEUE_ATTR_ID_SHUFFLE_MODE
@ AMS_QUEUE_ATTR_ID_SHUFFLE_MODE
Queue attribute index of shuffle mode.
Definition: ams_c.h:135
ams_c_attr_focus_set
sdk_err_t ams_c_attr_focus_set(uint8_t conn_idx, const ams_c_ett_attr_id_t *p_ett_attr_id)
Set concerned attribute.
ams_c_cmd_list_t::length
uint16_t length
Count of Command.
Definition: ams_c.h:183
ams_c_cplt_attr_data_t
Complete attribution's value .
Definition: ams_c.h:198
ams_c_evt_t::conn_idx
uint8_t conn_idx
The index of the connection.
Definition: ams_c.h:218
AMS_C_EVT_ATTR_UPDATE_NTF_SET_SUCCESS
@ AMS_C_EVT_ATTR_UPDATE_NTF_SET_SUCCESS
AMS Client has set focus attribute notification.
Definition: ams_c.h:159
AMS_C_EVT_WRITE_OP_ERR
@ AMS_C_EVT_WRITE_OP_ERR
Write error.
Definition: ams_c.h:162
ams_c_cmd_id_t
ams_c_cmd_id_t
Apple Media Service Command ID.
Definition: ams_c.h:97
AMS_C_EVT_CMD_UPDATE_RECEIVE
@ AMS_C_EVT_CMD_UPDATE_RECEIVE
AMS Client has recieved updated command list.
Definition: ams_c.h:155
ams_c_attr_info_t::length
uint16_t length
Length of attribute data.
Definition: ams_c.h:193
AMS_CMD_ID_NEXT_TRACK
@ AMS_CMD_ID_NEXT_TRACK
Command index of next track.
Definition: ams_c.h:101
ams_c_cplt_attr_read
sdk_err_t ams_c_cplt_attr_read(uint8_t conn_idx)
Read complete value of updated attrbute .
ams_c_handles_t::ams_attr_update_cccd_handle
uint16_t ams_attr_update_cccd_handle
AMS Service update attribute cccd handle.
Definition: ams_c.h:211
AMS_QUEUE_ATTR_ID_REPEAT_MODE
@ AMS_QUEUE_ATTR_ID_REPEAT_MODE
Queue attribute index of repeat mode.
Definition: ams_c.h:136
ams_c_evt_t::evt_type
ams_c_evt_type_t evt_type
The AMS event type.
Definition: ams_c.h:219
AMS_ETT_ID_TRACK
@ AMS_ETT_ID_TRACK
Entity index of track.
Definition: ams_c.h:119
ble_prf_types.h
Profile/Service Common Types.
ams_c_handles_t::ams_srvc_end_handle
uint16_t ams_srvc_end_handle
AMS Service end handle.
Definition: ams_c.h:207
sdk_err_t
uint16_t sdk_err_t
SDK API result type.
Definition: ble_error.h:243
AMS_ETT_ID_PLAYER
@ AMS_ETT_ID_PLAYER
Entity index of player.
Definition: ams_c.h:117
AMS_PLAYER_ATTR_ID_PLAYBACK_INFO
@ AMS_PLAYER_ATTR_ID_PLAYBACK_INFO
Player attribute index of playback information.
Definition: ams_c.h:126
AMS_C_ATTR_COUNT_MAX
#define AMS_C_ATTR_COUNT_MAX
The buffer size of command.
Definition: ams_c.h:78
ams_c_attr_info_t::flag
uint8_t flag
Flag about attribute.
Definition: ams_c.h:191
AMS_C_EVT_CPLT_ATTR_DISPLAY_SET_SUCCESS
@ AMS_C_EVT_CPLT_ATTR_DISPLAY_SET_SUCCESS
AMS Client has set the attribute which needs to be completely displayed.
Definition: ams_c.h:160
ams_c_attr_info_t
Structure that stores attribute information.
Definition: ams_c.h:188
AMS_CMD_ID_TOGGLE_PLAY_PAUSE
@ AMS_CMD_ID_TOGGLE_PLAY_PAUSE
Command index of toggle.
Definition: ams_c.h:100
ams_c_evt_handler_t
void(* ams_c_evt_handler_t)(ams_c_evt_t *p_evt)
Apple Media Service Client event handler type.
Definition: ams_c.h:234
ams_c_attr_display_set
sdk_err_t ams_c_attr_display_set(uint8_t conn_idx, const ams_c_attr_info_t *p_attr_info)
Set the attribute that needs to be completely displayed.
ams_c_cplt_attr_data_t::p_data
uint8_t * p_data
complete attribute data.
Definition: ams_c.h:199
AMS_CMD_ID_PLAY
@ AMS_CMD_ID_PLAY
Command index of play.
Definition: ams_c.h:98
AMS_CMD_ID_VOLUME_DOWN
@ AMS_CMD_ID_VOLUME_DOWN
Command index of volume down.
Definition: ams_c.h:104
ams_c_cmd_notify_set
sdk_err_t ams_c_cmd_notify_set(uint8_t conn_idx, bool is_enable)
Enable or disable peer new command list notify.
AMS_CMD_ID_ADVANCE_REPEAT_MODE
@ AMS_CMD_ID_ADVANCE_REPEAT_MODE
Command index of repeat mode.
Definition: ams_c.h:105
ams_c_cplt_attr_data_t::length
uint16_t length
Length of complete attribute data.
Definition: ams_c.h:200
AMS_CMD_ID_ADVANCE_SHUFFLE_MODE
@ AMS_CMD_ID_ADVANCE_SHUFFLE_MODE
Command index of shuffle mode.
Definition: ams_c.h:106
ams_c_cmd_list_t::p_cmd
ams_c_cmd_id_t * p_cmd
Command list.
Definition: ams_c.h:182
AMS_C_EVT_CMD_SEND_SUCCESS
@ AMS_C_EVT_CMD_SEND_SUCCESS
AMS Client has sent command.
Definition: ams_c.h:154
ams_c_evt_t::cmd_list
ams_c_cmd_list_t cmd_list
Command list.
Definition: ams_c.h:222
ams_c_evt_t
Apple Media Service Client event.
Definition: ams_c.h:217
ams_c_attr_info_t::p_data
uint8_t * p_data
Attribute data.
Definition: ams_c.h:192
ams_c_client_init
sdk_err_t ams_c_client_init(ams_c_evt_handler_t evt_handler)
Register AMS Client event handler.
AMS_CMD_ID_LIKE_TRACK
@ AMS_CMD_ID_LIKE_TRACK
Command index of like track.
Definition: ams_c.h:109
AMS_C_EVT_CMD_UPDATE_NTF_SET_SUCCESS
@ AMS_C_EVT_CMD_UPDATE_NTF_SET_SUCCESS
AMS Client has set command update notification.
Definition: ams_c.h:156
AMS_C_EVT_ATTR_FOCUS_SET_SUCCESS
@ AMS_C_EVT_ATTR_FOCUS_SET_SUCCESS
AMS Client has set focus attribute.
Definition: ams_c.h:157
ams_c_ett_attr_id_t
Structure that stores the attribute to be concerned or to display completely.
Definition: ams_c.h:173
AMS_C_EVT_DISCOVERY_CPLT
@ AMS_C_EVT_DISCOVERY_CPLT
AMS Client has found AMS service and its characteristics.
Definition: ams_c.h:152
AMS_PLAYER_ATTR_ID_VOLUME
@ AMS_PLAYER_ATTR_ID_VOLUME
Player attribute index of volume.
Definition: ams_c.h:127
ams_c_attr_info_t::ett_id
ams_c_ett_id_t ett_id
Entity index.
Definition: ams_c.h:189
AMS_C_EVT_CPLT_ATTR_READ_RSP
@ AMS_C_EVT_CPLT_ATTR_READ_RSP
AMS Client has received a read response.
Definition: ams_c.h:161
ams_c_handles_t::ams_cmd_cccd_handle
uint16_t ams_cmd_cccd_handle
AMS Service remote command cccd handle.
Definition: ams_c.h:209
AMS_CMD_ID_DISLIKE_TRACK
@ AMS_CMD_ID_DISLIKE_TRACK
Command index of dislike track.
Definition: ams_c.h:110
AMS_CMD_ID_PREVIOUS_TRACK
@ AMS_CMD_ID_PREVIOUS_TRACK
Command index of previous track.
Definition: ams_c.h:102
AMS_QUEUE_ATTR_ID_COUNT
@ AMS_QUEUE_ATTR_ID_COUNT
Queue attribute index of count.
Definition: ams_c.h:134
AMS_TRACK_ATTR_ID_ALBUM
@ AMS_TRACK_ATTR_ID_ALBUM
Track attribute index of album.
Definition: ams_c.h:143
ams_c_ett_id_t
ams_c_ett_id_t
Apple Media Service entities index.
Definition: ams_c.h:116
AMS_TRACK_ATTR_ID_ARTIST
@ AMS_TRACK_ATTR_ID_ARTIST
Track attribute index of artist.
Definition: ams_c.h:142
ams_c_handles_t::ams_attr_display_handle
uint16_t ams_attr_display_handle
AMS Service complete attribute display handle.
Definition: ams_c.h:212
AMS_PLAYER_ATTR_ID_NAME
@ AMS_PLAYER_ATTR_ID_NAME
Player attribute index of name.
Definition: ams_c.h:125
AMS_C_EVT_ATTR_UPDATE_RECEIVE
@ AMS_C_EVT_ATTR_UPDATE_RECEIVE
AMS Client has received updated attribution data.
Definition: ams_c.h:158