思澈科技软件开发工具包  2.20

Data Structures

struct  ble_ams_enable_rsp_t
 The structure of BLE_AMS_ENABLE_RSP. More...
 
struct  ble_ams_supported_cmd_notify_ind_t
 The structure of BLE_AMS_SUPPORTED_CMD_NOTIFY_IND. More...
 
struct  ble_ams_entity_attr_value_t
 The structure of BLE_AMS_ENTITY_ATTRIBUTE_PAIR_IND. More...
 

Macros

#define BLE_AMS_MAXIMUM_ATTR_COUNT   4
 

Enumerations

enum  ble_ams_event {
  BLE_AMS_ENABLE_RSP = BLE_AMS_TYPE,
  BLE_AMS_SUPPORTED_CMD_NOTIFY_IND,
  BLE_AMS_ENTITY_ATTRIBUTE_PAIR_IND
}
 AMS events that notify user. More...
 
enum  ble_ams_err {
  BLE_AMS_ERR_NO_ERR,
  BLE_AMS_ERR_NO_CONNECTION,
  BLE_AMS_ERR_SEARCH_REMOTE_SERVICE_FAILED,
  BLE_AMS_ERR_REGISTER_REMOTE_DEVICE_FAILED,
  BLE_AMS_ERR_REJECTED,
  BLE_AMS_ERR_GENERATE
}
 AMS error type. More...
 
enum  ble_ams_cmd_t {
  BLE_AMS_CMD_PLAY,
  BLE_AMS_CMD_PAUSE,
  BLE_AMS_CMD_TOGGLE_PLAY_PAUSE,
  BLE_AMS_CMD_NEXT,
  BLE_AMS_CMD_PREV,
  BLE_AMS_CMD_VOL_UP,
  BLE_AMS_CMD_VOL_DOWN,
  BLE_AMS_CMD_REPEAT_MODE,
  BLE_AMS_CMD_SHUFFLE_MODE,
  BLE_AMS_CMD_SKIP_FWD,
  BLE_AMS_CMD_SKIP_BACKWD,
  BLE_AMS_CMD_LIKE_TRACK,
  BLE_AMS_CMD_DISLIKE_TRACK,
  BLE_AMS_CMD_BOOKMARK_TRACK,
  BLE_AMS_CMD_TOTAL
}
 Remote commandID values. More...
 
enum  ble_ams_cmd_mask_t {
  BLE_AMS_CMD_PLAY_MASK = 1 << BLE_AMS_CMD_PLAY,
  BLE_AMS_CMD_PAUSE_MASK = 1 << BLE_AMS_CMD_PAUSE,
  BLE_AMS_CMD_TOGGLE_PLAY_PAUSE_MASK = 1 << BLE_AMS_CMD_TOGGLE_PLAY_PAUSE,
  BLE_AMS_CMD_NEXT_MASK = 1 << BLE_AMS_CMD_NEXT,
  BLE_AMS_CMD_PREV_MASK = 1 << BLE_AMS_CMD_PREV,
  BLE_AMS_CMD_VOL_UP_MASK = 1 << BLE_AMS_CMD_VOL_UP,
  BLE_AMS_CMD_VOL_DOWN_MASK = 1 << BLE_AMS_CMD_VOL_DOWN,
  BLE_AMS_CMD_REPEAT_MODE_MASK = 1 << BLE_AMS_CMD_REPEAT_MODE,
  BLE_AMS_CMD_SHUFFLE_MODE_MASK = 1 << BLE_AMS_CMD_SHUFFLE_MODE,
  BLE_AMS_CMD_SKIP_FWD_MASK = 1 << BLE_AMS_CMD_SKIP_FWD,
  BLE_AMS_CMD_SKIP_BACKWD_MASK = 1 << BLE_AMS_CMD_SKIP_BACKWD,
  BLE_AMS_CMD_LIKE_TRACK_MASK = 1 << BLE_AMS_CMD_LIKE_TRACK,
  BLE_AMS_CMD_DISLIKE_TRACK_MASK = 1 << BLE_AMS_CMD_DISLIKE_TRACK,
  BLE_AMS_CMD_BOOKMARK_TRACK_MASK = 1 << BLE_AMS_CMD_BOOKMARK_TRACK,
  BLE_AMS_CMD_MASK_ALL = 0xFFFF
}
 Remote commandID mask. commandID ble_ams_cmd_t. More...
 
enum  ble_ams_entity_id_t {
  BLE_AMS_ENTITY_ID_PLAYER,
  BLE_AMS_ENTITY_ID_QUEUE,
  BLE_AMS_ENTITY_ID_TRACK
}
 EntityID values. More...
 
enum  ble_ams_entity_player_attribute_t {
  BLE_AMS_PLAYER_ATTR_ID_NAME,
  BLE_AMS_PLAYER_ATTR_ID_PB_INFO,
  BLE_AMS_PLAYER_ATTR_ID_VOL
}
 Attribute of player entity. More...
 
enum  ble_ams_entity_player_attribute_mask_t {
  BLE_AMS_PLAYER_ATTR_ID_NAME_MASK = 1 << BLE_AMS_PLAYER_ATTR_ID_NAME,
  BLE_AMS_PLAYER_ATTR_ID_PB_INFO_MASK = 1 << BLE_AMS_PLAYER_ATTR_ID_PB_INFO,
  BLE_AMS_PLAYER_ATTR_ID_VOL_MASK = 1 << BLE_AMS_PLAYER_ATTR_ID_VOL,
  BLE_AMS_PLAYER_ATTR_ID_ALL_MASK = BLE_AMS_PLAYER_ATTR_ID_NAME_MASK | BLE_AMS_PLAYER_ATTR_ID_PB_INFO_MASK | BLE_AMS_PLAYER_ATTR_ID_VOL_MASK
}
 Mask of attribute of player entity. More...
 
enum  ble_ams_entity_queue_attribute_t {
  BLE_AMS_QUEUE_ATTR_ID_INDEX,
  BLE_AMS_QUEUE_ATTR_ID_COUNT,
  BLE_AMS_QUEUE_ATTR_ID_SHUFFLE,
  BLE_AMS_QUEUE_ATTR_ID_REPEAT
}
 Attribute of player queue. More...
 
enum  ble_ams_entity_queue_attribute_mask_t {
  BLE_AMS_QUEUE_ATTR_ID_INDEX_MASK = 1 << BLE_AMS_QUEUE_ATTR_ID_INDEX,
  BLE_AMS_QUEUE_ATTR_ID_COUNT_MASK = 1 << BLE_AMS_QUEUE_ATTR_ID_COUNT,
  BLE_AMS_QUEUE_ATTR_ID_SHUFFLE_MASK = 1 << BLE_AMS_QUEUE_ATTR_ID_SHUFFLE,
  BLE_AMS_QUEUE_ATTR_ID_REPEAT_MASK = 1 << BLE_AMS_QUEUE_ATTR_ID_REPEAT,
  BLE_AMS_QUEUE_ATTR_ID_ALL_MASK = BLE_AMS_QUEUE_ATTR_ID_INDEX_MASK | BLE_AMS_QUEUE_ATTR_ID_COUNT_MASK | BLE_AMS_QUEUE_ATTR_ID_SHUFFLE_MASK | BLE_AMS_QUEUE_ATTR_ID_REPEAT_MASK
}
 Mask of attribute of player queue. More...
 
enum  ble_ams_entity_track_attribute_t {
  BLE_AMS_TRACK_ATTR_ID_ARTIST,
  BLE_AMS_TRACK_ATTR_ID_ALBUM,
  BLE_AMS_TRACK_ATTR_ID_TILTE,
  BLE_AMS_TRACK_ATTR_ID_DURATION
}
 Attribute of track queue. More...
 
enum  ble_ams_entity_track_attribute_mask_t {
  BLE_AMS_TRACK_ATTR_ID_ARTIST_MASK = 1 << BLE_AMS_TRACK_ATTR_ID_ARTIST,
  BLE_AMS_TRACK_ATTR_ID_ALBUM_MASK = 1 << BLE_AMS_TRACK_ATTR_ID_ALBUM,
  BLE_AMS_TRACK_ATTR_ID_TILTE_MASK = 1 << BLE_AMS_TRACK_ATTR_ID_TILTE,
  BLE_AMS_TRACK_ATTR_ID_DURATION_MASK = 1 << BLE_AMS_TRACK_ATTR_ID_DURATION,
  BLE_AMS_TRACK_ATTR_ID_ALL_MASK = BLE_AMS_TRACK_ATTR_ID_ARTIST_MASK | BLE_AMS_TRACK_ATTR_ID_ALBUM_MASK | BLE_AMS_TRACK_ATTR_ID_TILTE_MASK | BLE_AMS_TRACK_ATTR_ID_DURATION_MASK
}
 Mask of attribute of track queue. More...
 

Functions

uint8_t ble_ams_enable (uint8_t conn_idx)
 Enable ams service. More...
 
uint8_t ble_ams_send_command (ble_ams_cmd_t cmd)
 Send remote commandID to media source. More...
 
uint8_t ble_ams_cccd_enable (uint8_t is_enable)
 Enable CCCD of media source. More...
 
void ble_ams_player_attr_enable (ble_ams_entity_player_attribute_mask_t attr_mask)
 Enable attribute of player entity. More...
 
void ble_ams_player_attr_disable (ble_ams_entity_player_attribute_mask_t attr_mask)
 Disable attribute of player entity. More...
 
void ble_ams_queue_attr_enable (ble_ams_entity_queue_attribute_mask_t attr_mask)
 Enable attribute of queue entity. More...
 
void ble_ams_queue_attr_disable (ble_ams_entity_queue_attribute_mask_t attr_mask)
 Disable attribute of queue entity. More...
 
void ble_ams_track_attr_enable (ble_ams_entity_track_attribute_mask_t attr_mask)
 Enable attribute of track entity. More...
 
void ble_ams_track_attr_disable (ble_ams_entity_track_attribute_mask_t attr_mask)
 Disable attribute of track entity. More...
 

Detailed Description

Enumeration Type Documentation

◆ ble_ams_cmd_mask_t

Remote commandID mask. commandID ble_ams_cmd_t.

Enumerator
BLE_AMS_CMD_PLAY_MASK 

Play command mask.

BLE_AMS_CMD_PAUSE_MASK 

Pause command mask.

BLE_AMS_CMD_TOGGLE_PLAY_PAUSE_MASK 

Toggle command mask.

BLE_AMS_CMD_NEXT_MASK 

Next command mask.

BLE_AMS_CMD_PREV_MASK 

Previous command mask.

BLE_AMS_CMD_VOL_UP_MASK 

Voloume up command mask.

BLE_AMS_CMD_VOL_DOWN_MASK 

Volume down command mask.

BLE_AMS_CMD_REPEAT_MODE_MASK 

Repeat mode command mask.

BLE_AMS_CMD_SHUFFLE_MODE_MASK 

Shuffle mode command mask.

BLE_AMS_CMD_SKIP_FWD_MASK 

Skip forward command mask.

BLE_AMS_CMD_SKIP_BACKWD_MASK 

Skip backward command mask.

BLE_AMS_CMD_LIKE_TRACK_MASK 

Like track command mask.

BLE_AMS_CMD_DISLIKE_TRACK_MASK 

Dislike track command mask.

BLE_AMS_CMD_BOOKMARK_TRACK_MASK 

Bookmark track command mask.

BLE_AMS_CMD_MASK_ALL 

Mask all commands.

◆ ble_ams_cmd_t

Remote commandID values.

Enumerator
BLE_AMS_CMD_PLAY 

Play command.

BLE_AMS_CMD_PAUSE 

Pause command.

BLE_AMS_CMD_TOGGLE_PLAY_PAUSE 

Toggle command.

BLE_AMS_CMD_NEXT 

Next command.

BLE_AMS_CMD_PREV 

Previous command.

BLE_AMS_CMD_VOL_UP 

Voloume up command.

BLE_AMS_CMD_VOL_DOWN 

Volume down command.

BLE_AMS_CMD_REPEAT_MODE 

Repeat mode command.

BLE_AMS_CMD_SHUFFLE_MODE 

Shuffle mode command.

BLE_AMS_CMD_SKIP_FWD 

Skip forward command.

BLE_AMS_CMD_SKIP_BACKWD 

Skip backward command.

BLE_AMS_CMD_LIKE_TRACK 

Like track command.

BLE_AMS_CMD_DISLIKE_TRACK 

Dislike track command.

BLE_AMS_CMD_BOOKMARK_TRACK 

Bookmark track command.

BLE_AMS_CMD_TOTAL 

Total commands number.

◆ ble_ams_entity_id_t

EntityID values.

Enumerator
BLE_AMS_ENTITY_ID_PLAYER 

Player entity. The attribute is ble_ams_entity_player_attribute_t.

BLE_AMS_ENTITY_ID_QUEUE 

Queue entity. The attribute is ble_ams_entity_queue_attribute_t.

BLE_AMS_ENTITY_ID_TRACK 

Track entity. The attribute is ble_ams_entity_queue_attribute_t.

◆ ble_ams_entity_player_attribute_mask_t

Mask of attribute of player entity.

Enumerator
BLE_AMS_PLAYER_ATTR_ID_NAME_MASK 

Mask of localized name of app.

BLE_AMS_PLAYER_ATTR_ID_PB_INFO_MASK 

Mask of playback info.

BLE_AMS_PLAYER_ATTR_ID_VOL_MASK 

Mask of volume.

BLE_AMS_PLAYER_ATTR_ID_ALL_MASK 

Mask of all attributes of player entity.

◆ ble_ams_entity_player_attribute_t

Attribute of player entity.

Enumerator
BLE_AMS_PLAYER_ATTR_ID_NAME 

Localized name of app.

BLE_AMS_PLAYER_ATTR_ID_PB_INFO 

Playback info.

BLE_AMS_PLAYER_ATTR_ID_VOL 

Volume.

◆ ble_ams_entity_queue_attribute_mask_t

Mask of attribute of player queue.

Enumerator
BLE_AMS_QUEUE_ATTR_ID_INDEX_MASK 

Mask of queue index.

BLE_AMS_QUEUE_ATTR_ID_COUNT_MASK 

Mask of total number of queue.

BLE_AMS_QUEUE_ATTR_ID_SHUFFLE_MASK 

Mask of shuffle mode.

BLE_AMS_QUEUE_ATTR_ID_REPEAT_MASK 

Mask of repeat mode.

BLE_AMS_QUEUE_ATTR_ID_ALL_MASK 

Mask of all attributes of queue entity.

◆ ble_ams_entity_queue_attribute_t

Attribute of player queue.

Enumerator
BLE_AMS_QUEUE_ATTR_ID_INDEX 

Queue index.

BLE_AMS_QUEUE_ATTR_ID_COUNT 

Total number of queue.

BLE_AMS_QUEUE_ATTR_ID_SHUFFLE 

Shuffle mode.

BLE_AMS_QUEUE_ATTR_ID_REPEAT 

Repeat mode.

◆ ble_ams_entity_track_attribute_mask_t

Mask of attribute of track queue.

Enumerator
BLE_AMS_TRACK_ATTR_ID_ARTIST_MASK 

Mask of name of artist.

BLE_AMS_TRACK_ATTR_ID_ALBUM_MASK 

Mask of name of album.

BLE_AMS_TRACK_ATTR_ID_TILTE_MASK 

Mask of title of track.

BLE_AMS_TRACK_ATTR_ID_DURATION_MASK 

Mask of total duration of the track in seconds.

BLE_AMS_TRACK_ATTR_ID_ALL_MASK 

Mask of all attributes of track entity.

◆ ble_ams_entity_track_attribute_t

Attribute of track queue.

Enumerator
BLE_AMS_TRACK_ATTR_ID_ARTIST 

The name of artist.

BLE_AMS_TRACK_ATTR_ID_ALBUM 

The name of album.

BLE_AMS_TRACK_ATTR_ID_TILTE 

The title of track.

BLE_AMS_TRACK_ATTR_ID_DURATION 

Total duration of the track in seconds.

◆ ble_ams_err

AMS error type.

Enumerator
BLE_AMS_ERR_NO_ERR 

No error.

BLE_AMS_ERR_NO_CONNECTION 

No connection yet.

BLE_AMS_ERR_SEARCH_REMOTE_SERVICE_FAILED 

Remote device doesn't support AMS source.

BLE_AMS_ERR_REGISTER_REMOTE_DEVICE_FAILED 

Register remote deivce failed.

BLE_AMS_ERR_REJECTED 

Current action is rejected due to, etc, the action is on-going.

BLE_AMS_ERR_GENERATE 

Generate error.

◆ ble_ams_event

AMS events that notify user.

Enumerator
BLE_AMS_ENABLE_RSP 

Enable result response.

BLE_AMS_SUPPORTED_CMD_NOTIFY_IND 

Media source supported command indication.

BLE_AMS_ENTITY_ATTRIBUTE_PAIR_IND 

Entity attribute pair indication.

Function Documentation

◆ ble_ams_cccd_enable()

uint8_t ble_ams_cccd_enable ( uint8_t  is_enable)

Enable CCCD of media source.

Parameters
[in]is_enablewhether enabled.
Return values
result.BLE_AMS_ERR_NO_ERRis successful.

◆ ble_ams_enable()

uint8_t ble_ams_enable ( uint8_t  conn_idx)

Enable ams service.

Parameters
[in]conn_idxConnection index.
Return values
result.BLE_AMS_ERR_NO_ERRis successful.

◆ ble_ams_player_attr_disable()

void ble_ams_player_attr_disable ( ble_ams_entity_player_attribute_mask_t  attr_mask)

Disable attribute of player entity.

Parameters
[in]attr_maskattribute mask.

◆ ble_ams_player_attr_enable()

void ble_ams_player_attr_enable ( ble_ams_entity_player_attribute_mask_t  attr_mask)

Enable attribute of player entity.

Parameters
[in]attr_maskattribute mask.

◆ ble_ams_queue_attr_disable()

void ble_ams_queue_attr_disable ( ble_ams_entity_queue_attribute_mask_t  attr_mask)

Disable attribute of queue entity.

Parameters
[in]attr_maskattribute mask.

◆ ble_ams_queue_attr_enable()

void ble_ams_queue_attr_enable ( ble_ams_entity_queue_attribute_mask_t  attr_mask)

Enable attribute of queue entity.

Parameters
[in]attr_maskattribute mask.

◆ ble_ams_send_command()

uint8_t ble_ams_send_command ( ble_ams_cmd_t  cmd)

Send remote commandID to media source.

Parameters
[in]cmdcommandID.
Return values
result.BLE_AMS_ERR_NO_ERRis successful.

◆ ble_ams_track_attr_disable()

void ble_ams_track_attr_disable ( ble_ams_entity_track_attribute_mask_t  attr_mask)

Disable attribute of track entity.

Parameters
[in]attr_maskattribute mask.

◆ ble_ams_track_attr_enable()

void ble_ams_track_attr_enable ( ble_ams_entity_track_attribute_mask_t  attr_mask)

Enable attribute of track entity.

Parameters
[in]attr_maskattribute mask.