ams_c.h File Reference
#include "gr55xx_sys.h"
#include "ble_prf_types.h"
#include "custom_config.h"

Go to the source code of this file.

Classes

struct  ams_c_ett_attr_id_t
 Structure that stores the attribute to be concerned or to display completely. More...
 
struct  ams_c_cmd_list_t
 Structure that stores new command list. More...
 
struct  ams_c_attr_info_t
 Structure that stores attribute information. More...
 
struct  ams_c_cplt_attr_data_t
 Complete attribution's value . More...
 
struct  ams_c_handles_t
 Handles on the connected peer device needed to interact with it. More...
 
struct  ams_c_evt_t
 Apple Media Service Client event. More...
 

Macros

#define AMS_C_CONNECTION_MAX
 Maximum number of HRS Client connections. More...
 
#define AMS_C_ATTR_COUNT_MAX   256
 The buffer size of command. More...
 
#define AMS_C_TRUNCATED_FLAG   (0x01<<0)
 Bit of truncated. More...
 
#define AMS_SRVC_UUID
 UUID of Apple media service. More...
 
#define AMS_CMD_UUID
 UUID of remote command. More...
 
#define AMS_ATTR_UPDATE_UUID
 UUID of attribute update. More...
 
#define AMS_ATTR_DISPLAY_UUID
 UUID of attribute display. More...
 

Typedefs

typedef void(* ams_c_evt_handler_t) (ams_c_evt_t *p_evt)
 Apple Media Service Client event handler type. More...
 

Enumerations

enum  ams_c_cmd_id_t {
  AMS_CMD_ID_PLAY, AMS_CMD_ID_PAUSE, AMS_CMD_ID_TOGGLE_PLAY_PAUSE, AMS_CMD_ID_NEXT_TRACK,
  AMS_CMD_ID_PREVIOUS_TRACK, AMS_CMD_ID_VOLUME_UP, AMS_CMD_ID_VOLUME_DOWN, AMS_CMD_ID_ADVANCE_REPEAT_MODE,
  AMS_CMD_ID_ADVANCE_SHUFFLE_MODE, AMS_CMD_ID_SKIP_FORWARD, AMS_CMD_ID_SKIP_BACKWARD, AMS_CMD_ID_LIKE_TRACK,
  AMS_CMD_ID_DISLIKE_TRACK, AMS_CMD_ID_BOOK_MARK_TRACK
}
 Apple Media Service Command ID. More...
 
enum  ams_c_ett_id_t { AMS_ETT_ID_PLAYER, AMS_ETT_ID_QUEUE, AMS_ETT_ID_TRACK }
 Apple Media Service entities index. More...
 
enum  {
  AMS_PLAYER_ATTR_ID_NAME, AMS_PLAYER_ATTR_ID_PLAYBACK_INFO, AMS_PLAYER_ATTR_ID_VOLUME, IAS_ALERT_NONE,
  IAS_ALERT_MILD, IAS_ALERT_HIGH, TRC_PWR_WFE_MODE = 0, TRC_PWR_DSLEEP_MODE,
  TRC_PWR_ACTIVE_MODE, TRC_PWR_BLE_RET_DSLEEP, TRC_PWR_APP_TIMER_REFUSE, TRC_PWR_APP_TIMER_PASS,
  TRC_PWR_BLE_TIMER_PASS
}
 Apple Media Service player attribute index. More...
 
enum  { AMS_QUEUE_ATTR_ID_INDEX, AMS_QUEUE_ATTR_ID_COUNT, AMS_QUEUE_ATTR_ID_SHUFFLE_MODE, AMS_QUEUE_ATTR_ID_REPEAT_MODE }
 Apple Media Service queue attribute index. More...
 
enum  { AMS_TRACK_ATTR_ID_ARTIST, AMS_TRACK_ATTR_ID_ALBUM, AMS_TRACK_ATTR_ID_TITTLE, AMS_TRACK_ATTR_ID_DURATION }
 Apple Media Service track attribute index. More...
 
enum  ams_c_evt_type_t {
  AMS_C_EVT_INVALID, AMS_C_EVT_DISCOVERY_CPLT, AMS_C_EVT_DISCOVERY_FAIL, AMS_C_EVT_CMD_SEND_SUCCESS,
  AMS_C_EVT_CMD_UPDATE_RECEIVE, AMS_C_EVT_CMD_UPDATE_NTF_SET_SUCCESS, AMS_C_EVT_ATTR_FOCUS_SET_SUCCESS, AMS_C_EVT_ATTR_UPDATE_RECEIVE,
  AMS_C_EVT_ATTR_UPDATE_NTF_SET_SUCCESS, AMS_C_EVT_CPLT_ATTR_DISPLAY_SET_SUCCESS, AMS_C_EVT_CPLT_ATTR_READ_RSP, AMS_C_EVT_WRITE_OP_ERR
}
 Apple Media Service Client Event type. More...
 

Functions

sdk_err_t ams_c_client_init (ams_c_evt_handler_t evt_handler)
 Register AMS Client event handler. More...
 
sdk_err_t ams_c_disc_srvc_start (uint8_t conn_idx)
 Discover Apple Media Service on peer. More...
 
sdk_err_t ams_c_cmd_notify_set (uint8_t conn_idx, bool is_enable)
 Enable or disable peer new command list notify. More...
 
sdk_err_t ams_c_attr_update_notify_set (uint8_t conn_idx, bool is_enable)
 Enable or disable peer updated attribute notify. More...
 
sdk_err_t ams_c_cplt_attr_read (uint8_t conn_idx)
 Read complete value of updated attrbute . More...
 
sdk_err_t ams_c_cmd_send (uint8_t conn_idx, uint8_t cmd_id)
 Send command to peer device. More...
 
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. More...
 
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. More...
 
bool ams_c_cmd_enable_check (ams_c_cmd_id_t cmd_id)
 Check if the command is available. More...