Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2012 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ANDROID_INCLUDE_BT_RC_H |
| 18 | #define ANDROID_INCLUDE_BT_RC_H |
| 19 | |
| 20 | __BEGIN_DECLS |
| 21 | |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 22 | /* Change this macro to use multiple RC */ |
| 23 | #define BT_RC_NUM_APP 1 |
| 24 | |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 25 | /* Macros */ |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 26 | #define BTRC_MAX_ATTR_STR_LEN (1 << 16) |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 27 | #define BTRC_UID_SIZE 8 |
| 28 | #define BTRC_MAX_APP_SETTINGS 8 |
| 29 | #define BTRC_MAX_FOLDER_DEPTH 4 |
| 30 | #define BTRC_MAX_APP_ATTR_SIZE 16 |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 31 | #define BTRC_MAX_ELEM_ATTR_SIZE 8 |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 32 | #define BTRC_FEATURE_BIT_MASK_SIZE 16 |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 33 | |
| 34 | /* Macros for valid scopes in get_folder_items */ |
| 35 | #define BTRC_SCOPE_PLAYER_LIST 0x00 /* Media Player List */ |
| 36 | #define BTRC_SCOPE_FILE_SYSTEM 0x01 /* Virtual File System */ |
| 37 | #define BTRC_SCOPE_SEARCH 0x02 /* Search */ |
| 38 | #define BTRC_SCOPE_NOW_PLAYING 0x03 /* Now Playing */ |
| 39 | |
| 40 | /* Macros for supported character encoding */ |
| 41 | #define BTRC_CHARSET_ID_UTF8 0x006A |
| 42 | |
| 43 | /* Macros for item types */ |
| 44 | #define BTRC_ITEM_PLAYER 0x01 /* Media Player */ |
| 45 | #define BTRC_ITEM_FOLDER 0x02 /* Folder */ |
| 46 | #define BTRC_ITEM_MEDIA 0x03 /* Media File */ |
| 47 | |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 48 | /* Macros for media attribute IDs */ |
| 49 | #define BTRC_MEDIA_ATTR_ID_INVALID -1 |
| 50 | #define BTRC_MEDIA_ATTR_ID_TITLE 0x00000001 |
| 51 | #define BTRC_MEDIA_ATTR_ID_ARTIST 0x00000002 |
| 52 | #define BTRC_MEDIA_ATTR_ID_ALBUM 0x00000003 |
| 53 | #define BTRC_MEDIA_ATTR_ID_TRACK_NUM 0x00000004 |
| 54 | #define BTRC_MEDIA_ATTR_ID_NUM_TRACKS 0x00000005 |
| 55 | #define BTRC_MEDIA_ATTR_ID_GENRE 0x00000006 |
| 56 | #define BTRC_MEDIA_ATTR_ID_PLAYING_TIME 0x00000007 /* in miliseconds */ |
| 57 | |
| 58 | /* Macros for folder types */ |
| 59 | #define BTRC_FOLDER_TYPE_MIXED 0x00 |
| 60 | #define BTRC_FOLDER_TYPE_TITLES 0x01 |
| 61 | #define BTRC_FOLDER_TYPE_ALBUMS 0x02 |
| 62 | #define BTRC_FOLDER_TYPE_ARTISTS 0x03 |
| 63 | #define BTRC_FOLDER_TYPE_GENRES 0x04 |
| 64 | #define BTRC_FOLDER_TYPE_PLAYLISTS 0x05 |
| 65 | #define BTRC_FOLDER_TYPE_YEARS 0x06 |
| 66 | |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 67 | /* Macros for media types */ |
| 68 | #define BTRC_MEDIA_TYPE_AUDIO 0x00 /* audio */ |
| 69 | #define BTRC_MEDIA_TYPE_VIDEO 0x01 /* video */ |
| 70 | |
| 71 | /* Macros for num attributes */ |
| 72 | #define BTRC_NUM_ATTR_NONE 0xFF /* No attributes required */ |
| 73 | #define BTRC_NUM_ATTR_ALL 0X00 /* All attributes required */ |
| 74 | |
| 75 | #define BTRC_HANDLE_NONE 0xFF |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 76 | |
| 77 | typedef uint8_t btrc_uid_t[BTRC_UID_SIZE]; |
| 78 | |
| 79 | typedef enum { |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 80 | BTRC_CONNECTION_STATE_DISCONNECTED = 0, |
| 81 | BTRC_CONNECTION_STATE_CONNECTED |
| 82 | } btrc_connection_state_t; |
| 83 | |
| 84 | typedef enum { |
Satya Calloji | fe9728d | 2013-08-01 03:11:11 -0700 | [diff] [blame] | 85 | BTRC_FEAT_NONE = 0x00, /* AVRCP 1.0 */ |
| 86 | BTRC_FEAT_METADATA = 0x01, /* AVRCP 1.3 */ |
| 87 | BTRC_FEAT_ABSOLUTE_VOLUME = 0x02, /* Supports TG role and volume sync */ |
| 88 | BTRC_FEAT_BROWSE = 0x04, /* AVRCP 1.4 and up, with Browsing support */ |
| 89 | } btrc_remote_features_t; |
| 90 | |
| 91 | typedef enum { |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 92 | BTRC_PLAYSTATE_STOPPED = 0x00, /* Stopped */ |
| 93 | BTRC_PLAYSTATE_PLAYING = 0x01, /* Playing */ |
| 94 | BTRC_PLAYSTATE_PAUSED = 0x02, /* Paused */ |
| 95 | BTRC_PLAYSTATE_FWD_SEEK = 0x03, /* Fwd Seek*/ |
| 96 | BTRC_PLAYSTATE_REV_SEEK = 0x04, /* Rev Seek*/ |
| 97 | BTRC_PLAYSTATE_ERROR = 0xFF, /* Error */ |
| 98 | } btrc_play_status_t; |
| 99 | |
| 100 | typedef enum { |
| 101 | BTRC_EVT_PLAY_STATUS_CHANGED = 0x01, |
| 102 | BTRC_EVT_TRACK_CHANGE = 0x02, |
| 103 | BTRC_EVT_TRACK_REACHED_END = 0x03, |
| 104 | BTRC_EVT_TRACK_REACHED_START = 0x04, |
| 105 | BTRC_EVT_PLAY_POS_CHANGED = 0x05, |
| 106 | BTRC_EVT_APP_SETTINGS_CHANGED = 0x08, |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 107 | BTRC_EVT_NOW_PLAYING_CONTENT_CHANGED = 0x09, |
| 108 | BTRC_EVT_AVAL_PLAYER_CHANGE = 0x0a, |
| 109 | BTRC_EVT_ADDR_PLAYER_CHANGE = 0x0b, |
| 110 | BTRC_EVT_UIDS_CHANGED = 0x0c, |
| 111 | BTRC_EVT_VOL_CHANGED = 0x0d, |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 112 | } btrc_event_id_t; |
| 113 | |
| 114 | typedef enum { |
| 115 | BTRC_NOTIFICATION_TYPE_INTERIM = 0, |
| 116 | BTRC_NOTIFICATION_TYPE_CHANGED = 1, |
| 117 | } btrc_notification_type_t; |
| 118 | |
| 119 | typedef enum { |
| 120 | BTRC_PLAYER_ATTR_EQUALIZER = 0x01, |
| 121 | BTRC_PLAYER_ATTR_REPEAT = 0x02, |
| 122 | BTRC_PLAYER_ATTR_SHUFFLE = 0x03, |
| 123 | BTRC_PLAYER_ATTR_SCAN = 0x04, |
| 124 | } btrc_player_attr_t; |
| 125 | |
| 126 | typedef enum { |
| 127 | BTRC_MEDIA_ATTR_TITLE = 0x01, |
| 128 | BTRC_MEDIA_ATTR_ARTIST = 0x02, |
| 129 | BTRC_MEDIA_ATTR_ALBUM = 0x03, |
| 130 | BTRC_MEDIA_ATTR_TRACK_NUM = 0x04, |
| 131 | BTRC_MEDIA_ATTR_NUM_TRACKS = 0x05, |
| 132 | BTRC_MEDIA_ATTR_GENRE = 0x06, |
| 133 | BTRC_MEDIA_ATTR_PLAYING_TIME = 0x07, |
| 134 | } btrc_media_attr_t; |
| 135 | |
| 136 | typedef enum { |
| 137 | BTRC_PLAYER_VAL_OFF_REPEAT = 0x01, |
| 138 | BTRC_PLAYER_VAL_SINGLE_REPEAT = 0x02, |
| 139 | BTRC_PLAYER_VAL_ALL_REPEAT = 0x03, |
| 140 | BTRC_PLAYER_VAL_GROUP_REPEAT = 0x04 |
| 141 | } btrc_player_repeat_val_t; |
| 142 | |
| 143 | typedef enum { |
| 144 | BTRC_PLAYER_VAL_OFF_SHUFFLE = 0x01, |
| 145 | BTRC_PLAYER_VAL_ALL_SHUFFLE = 0x02, |
| 146 | BTRC_PLAYER_VAL_GROUP_SHUFFLE = 0x03 |
| 147 | } btrc_player_shuffle_val_t; |
| 148 | |
| 149 | typedef enum { |
| 150 | BTRC_STS_BAD_CMD = 0x00, /* Invalid command */ |
| 151 | BTRC_STS_BAD_PARAM = 0x01, /* Invalid parameter */ |
| 152 | BTRC_STS_NOT_FOUND = 0x02, /* Specified parameter is wrong or not found */ |
| 153 | BTRC_STS_INTERNAL_ERR = 0x03, /* Internal Error */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 154 | BTRC_STS_NO_ERROR = 0x04, /* Operation Success */ |
| 155 | BTRC_STS_UID_CHANGED = 0x05, /* UIDs changed */ |
| 156 | BTRC_STS_RESERVED = 0x06, /* Reserved */ |
| 157 | BTRC_STS_INV_DIRN = 0x07, /* Invalid direction */ |
| 158 | BTRC_STS_INV_DIRECTORY = 0x08, /* Invalid directory */ |
| 159 | BTRC_STS_INV_ITEM = 0x09, /* Invalid Item */ |
| 160 | BTRC_STS_INV_SCOPE = 0x0a, /* Invalid scope */ |
| 161 | BTRC_STS_INV_RANGE = 0x0b, /* Invalid range */ |
| 162 | BTRC_STS_DIRECTORY = 0x0c, /* UID is a directory */ |
| 163 | BTRC_STS_MEDIA_IN_USE = 0x0d, /* Media in use */ |
| 164 | BTRC_STS_PLAY_LIST_FULL = 0x0e, /* Playing list full */ |
| 165 | BTRC_STS_SRCH_NOT_SPRTD = 0x0f, /* Search not supported */ |
| 166 | BTRC_STS_SRCH_IN_PROG = 0x10, /* Search in progress */ |
| 167 | BTRC_STS_INV_PLAYER = 0x11, /* Invalid player */ |
| 168 | BTRC_STS_PLAY_NOT_BROW = 0x12, /* Player not browsable */ |
| 169 | BTRC_STS_PLAY_NOT_ADDR = 0x13, /* Player not addressed */ |
| 170 | BTRC_STS_INV_RESULTS = 0x14, /* Invalid results */ |
| 171 | BTRC_STS_NO_AVBL_PLAY = 0x15, /* No available players */ |
| 172 | BTRC_STS_ADDR_PLAY_CHGD = 0x16, /* Addressed player changed */ |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 173 | } btrc_status_t; |
| 174 | |
| 175 | typedef struct { |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 176 | uint16_t player_id; |
| 177 | uint16_t uid_counter; |
| 178 | } btrc_addr_player_changed_t; |
| 179 | |
| 180 | typedef struct { |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 181 | uint8_t num_attr; |
| 182 | uint8_t attr_ids[BTRC_MAX_APP_SETTINGS]; |
| 183 | uint8_t attr_values[BTRC_MAX_APP_SETTINGS]; |
| 184 | } btrc_player_settings_t; |
| 185 | |
AnubhavGupta | a5b557a | 2015-09-18 14:34:02 +0530 | [diff] [blame] | 186 | typedef struct { |
| 187 | uint8_t val; |
| 188 | uint16_t charset_id; |
| 189 | uint16_t str_len; |
| 190 | uint8_t *p_str; |
| 191 | } btrc_player_app_ext_attr_val_t; |
| 192 | |
| 193 | typedef struct { |
| 194 | uint8_t attr_id; |
| 195 | uint16_t charset_id; |
| 196 | uint16_t str_len; |
| 197 | uint8_t *p_str; |
| 198 | uint8_t num_val; |
| 199 | btrc_player_app_ext_attr_val_t ext_attr_val[BTRC_MAX_APP_ATTR_SIZE]; |
| 200 | } btrc_player_app_ext_attr_t; |
| 201 | |
| 202 | typedef struct { |
| 203 | uint8_t attr_id; |
| 204 | uint8_t num_val; |
| 205 | uint8_t attr_val[BTRC_MAX_APP_ATTR_SIZE]; |
| 206 | } btrc_player_app_attr_t; |
| 207 | |
| 208 | typedef struct { |
| 209 | uint32_t start_item; |
| 210 | uint32_t end_item; |
| 211 | uint32_t size; |
| 212 | uint32_t attrs[BTRC_MAX_ELEM_ATTR_SIZE]; |
| 213 | uint8_t attr_count; |
| 214 | } btrc_getfolderitem_t; |
| 215 | |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 216 | typedef struct { |
| 217 | uint16_t type; |
| 218 | uint16_t uid_counter; |
| 219 | } btrc_uids_changed_t; |
| 220 | |
| 221 | typedef struct { |
| 222 | uint16_t type; |
| 223 | } btrc_now_playing_changed_t; |
| 224 | |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 225 | typedef union |
| 226 | { |
| 227 | btrc_play_status_t play_status; |
| 228 | btrc_uid_t track; /* queue position in NowPlaying */ |
| 229 | uint32_t song_pos; |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 230 | uint16_t uid_counter; |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 231 | btrc_player_settings_t player_setting; |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 232 | btrc_addr_player_changed_t addr_player_changed; |
| 233 | btrc_uids_changed_t uids_changed; |
| 234 | btrc_now_playing_changed_t now_playing_changed; |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 235 | } btrc_register_notification_t; |
| 236 | |
| 237 | typedef struct { |
| 238 | uint8_t id; /* can be attr_id or value_id */ |
| 239 | uint8_t text[BTRC_MAX_ATTR_STR_LEN]; |
| 240 | } btrc_player_setting_text_t; |
| 241 | |
| 242 | typedef struct { |
| 243 | uint32_t attr_id; |
| 244 | uint8_t text[BTRC_MAX_ATTR_STR_LEN]; |
| 245 | } btrc_element_attr_val_t; |
| 246 | |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 247 | typedef struct { |
| 248 | uint16_t player_id; |
| 249 | uint8_t major_type; |
| 250 | uint32_t sub_type; |
| 251 | uint8_t play_status; |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 252 | uint8_t features[BTRC_FEATURE_BIT_MASK_SIZE]; |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 253 | uint16_t charset_id; |
| 254 | uint8_t name[BTRC_MAX_ATTR_STR_LEN]; |
| 255 | } btrc_item_player_t; |
| 256 | |
| 257 | typedef struct { |
| 258 | uint8_t uid[BTRC_UID_SIZE]; |
| 259 | uint8_t type; |
| 260 | uint8_t playable; |
| 261 | uint16_t charset_id; |
| 262 | uint8_t name[BTRC_MAX_ATTR_STR_LEN]; |
| 263 | } btrc_item_folder_t; |
| 264 | |
| 265 | typedef struct { |
| 266 | uint8_t uid[BTRC_UID_SIZE]; |
| 267 | uint8_t type; |
| 268 | uint16_t charset_id; |
| 269 | uint8_t name[BTRC_MAX_ATTR_STR_LEN]; |
| 270 | int num_attrs; |
| 271 | btrc_element_attr_val_t* p_attrs; |
| 272 | } btrc_item_media_t; |
| 273 | |
| 274 | typedef struct { |
| 275 | uint8_t item_type; |
| 276 | union |
| 277 | { |
| 278 | btrc_item_player_t player; |
| 279 | btrc_item_folder_t folder; |
| 280 | btrc_item_media_t media; |
| 281 | }; |
| 282 | } btrc_folder_items_t; |
| 283 | |
| 284 | typedef struct { |
| 285 | uint16_t str_len; |
| 286 | uint8_t p_str[BTRC_MAX_ATTR_STR_LEN]; |
| 287 | } btrc_br_folder_name_t; |
| 288 | |
Satya Calloji | fe9728d | 2013-08-01 03:11:11 -0700 | [diff] [blame] | 289 | /** Callback for the controller's supported feautres */ |
| 290 | typedef void (* btrc_remote_features_callback)(bt_bdaddr_t *bd_addr, |
| 291 | btrc_remote_features_t features); |
| 292 | |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 293 | /** Callback for play status request */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 294 | typedef void (* btrc_get_play_status_callback)(bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 295 | |
| 296 | /** Callback for list player application attributes (Shuffle, Repeat,...) */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 297 | typedef void (* btrc_list_player_app_attr_callback)(bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 298 | |
| 299 | /** Callback for list player application attributes (Shuffle, Repeat,...) */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 300 | typedef void (* btrc_list_player_app_values_callback)(btrc_player_attr_t attr_id, |
| 301 | bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 302 | |
| 303 | /** Callback for getting the current player application settings value |
| 304 | ** num_attr: specifies the number of attribute ids contained in p_attrs |
| 305 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 306 | typedef void (* btrc_get_player_app_value_callback) (uint8_t num_attr, |
| 307 | btrc_player_attr_t *p_attrs, bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 308 | |
| 309 | /** Callback for getting the player application settings attributes' text |
| 310 | ** num_attr: specifies the number of attribute ids contained in p_attrs |
| 311 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 312 | typedef void (* btrc_get_player_app_attrs_text_callback) (uint8_t num_attr, |
| 313 | btrc_player_attr_t *p_attrs, bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 314 | |
| 315 | /** Callback for getting the player application settings values' text |
| 316 | ** num_attr: specifies the number of value ids contained in p_vals |
| 317 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 318 | typedef void (* btrc_get_player_app_values_text_callback) (uint8_t attr_id, uint8_t num_val, |
| 319 | uint8_t *p_vals, bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 320 | |
| 321 | /** Callback for setting the player application settings values */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 322 | typedef void (* btrc_set_player_app_value_callback) (btrc_player_settings_t *p_vals, |
| 323 | bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 324 | |
| 325 | /** Callback to fetch the get element attributes of the current song |
| 326 | ** num_attr: specifies the number of attributes requested in p_attrs |
| 327 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 328 | typedef void (* btrc_get_element_attr_callback) (uint8_t num_attr, btrc_media_attr_t *p_attrs, |
| 329 | bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 330 | |
| 331 | /** Callback for register notification (Play state change/track change/...) |
| 332 | ** param: Is only valid if event_id is BTRC_EVT_PLAY_POS_CHANGED |
| 333 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 334 | typedef void (* btrc_register_notification_callback) (btrc_event_id_t event_id, uint32_t param, |
| 335 | bt_bdaddr_t *bd_addr); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 336 | |
Satya Calloji | fe9728d | 2013-08-01 03:11:11 -0700 | [diff] [blame] | 337 | /* AVRCP 1.4 Enhancements */ |
| 338 | /** Callback for volume change on CT |
| 339 | ** volume: Current volume setting on the CT (0-127) |
| 340 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 341 | typedef void (* btrc_volume_change_callback) (uint8_t volume, uint8_t ctype, bt_bdaddr_t *bd_addr); |
Satya Calloji | fe9728d | 2013-08-01 03:11:11 -0700 | [diff] [blame] | 342 | |
John Du | b984481 | 2013-07-23 17:15:34 -0700 | [diff] [blame] | 343 | /** Callback for passthrough commands */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 344 | typedef void (* btrc_passthrough_cmd_callback) (int id, int key_state, bt_bdaddr_t *bd_addr); |
| 345 | |
| 346 | /** Callback for set addressed player response on TG **/ |
| 347 | typedef void (* btrc_set_addressed_player_callback) (uint16_t player_id, bt_bdaddr_t *bd_addr); |
| 348 | |
| 349 | /** Callback for set browsed player response on TG **/ |
| 350 | typedef void (* btrc_set_browsed_player_callback) (uint16_t player_id, bt_bdaddr_t *bd_addr); |
| 351 | |
| 352 | /** Callback for get folder items on TG |
| 353 | ** num_attr: specifies the number of attributes requested in p_attr_ids |
| 354 | */ |
| 355 | typedef void (* btrc_get_folder_items_callback) (uint8_t scope, uint32_t start_item, |
| 356 | uint32_t end_item, uint8_t num_attr, uint32_t *p_attr_ids, bt_bdaddr_t *bd_addr); |
| 357 | |
| 358 | /** Callback for changing browsed path on TG **/ |
| 359 | typedef void (* btrc_change_path_callback) (uint8_t direction, |
| 360 | uint8_t* folder_uid, bt_bdaddr_t *bd_addr); |
| 361 | |
| 362 | /** Callback to fetch the get item attributes of the media item |
| 363 | ** num_attr: specifies the number of attributes requested in p_attrs |
| 364 | */ |
| 365 | typedef void (* btrc_get_item_attr_callback) (uint8_t scope, uint8_t* uid, uint16_t uid_counter, |
| 366 | uint8_t num_attr, btrc_media_attr_t *p_attrs, bt_bdaddr_t *bd_addr); |
| 367 | |
| 368 | /** Callback for play request for the media item indicated by an identifier */ |
| 369 | typedef void (* btrc_play_item_callback) (uint8_t scope, |
| 370 | uint16_t uid_counter, uint8_t* uid, bt_bdaddr_t *bd_addr); |
| 371 | |
| 372 | /** Callback to fetch total number of items from a folder **/ |
| 373 | typedef void (* btrc_get_total_num_of_items_callback) (uint8_t scope, bt_bdaddr_t *bd_addr); |
| 374 | |
| 375 | /** Callback for conducting recursive search on a current browsed path for a specified string */ |
| 376 | typedef void (* btrc_search_callback) (uint16_t charset_id, |
| 377 | uint16_t str_len, uint8_t* p_str, bt_bdaddr_t *bd_addr); |
| 378 | |
| 379 | /** Callback to add a specified media item indicated by an identifier to now playing queue. */ |
| 380 | typedef void (* btrc_add_to_now_playing_callback) (uint8_t scope, |
| 381 | uint8_t* uid, uint16_t uid_counter, bt_bdaddr_t *bd_addr); |
John Du | b984481 | 2013-07-23 17:15:34 -0700 | [diff] [blame] | 382 | |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 383 | /** Callback for set addressed player response on TG **/ |
| 384 | typedef void (* btrc_set_addressed_player_callback) (uint16_t player_id, bt_bdaddr_t *bd_addr); |
| 385 | |
| 386 | /** Callback for set browsed player response on TG **/ |
| 387 | typedef void (* btrc_set_browsed_player_callback) (uint16_t player_id, bt_bdaddr_t *bd_addr); |
| 388 | |
| 389 | /** Callback for get folder items on TG |
| 390 | ** num_attr: specifies the number of attributes requested in p_attr_ids |
| 391 | */ |
| 392 | typedef void (* btrc_get_folder_items_callback) (uint8_t scope, uint32_t start_item, |
| 393 | uint32_t end_item, uint8_t num_attr, uint32_t *p_attr_ids, bt_bdaddr_t *bd_addr); |
| 394 | |
| 395 | /** Callback for changing browsed path on TG **/ |
| 396 | typedef void (* btrc_change_path_callback) (uint8_t direction, |
| 397 | uint8_t* folder_uid, bt_bdaddr_t *bd_addr); |
| 398 | |
| 399 | /** Callback to fetch the get item attributes of the media item |
| 400 | ** num_attr: specifies the number of attributes requested in p_attrs |
| 401 | */ |
| 402 | typedef void (* btrc_get_item_attr_callback) (uint8_t scope, uint8_t* uid, uint16_t uid_counter, |
| 403 | uint8_t num_attr, btrc_media_attr_t *p_attrs, bt_bdaddr_t *bd_addr); |
| 404 | |
| 405 | /** Callback for play request for the media item indicated by an identifier */ |
| 406 | typedef void (* btrc_play_item_callback) (uint8_t scope, |
| 407 | uint16_t uid_counter, uint8_t* uid, bt_bdaddr_t *bd_addr); |
| 408 | |
| 409 | /** Callback to fetch total number of items from a folder **/ |
| 410 | typedef void (* btrc_get_total_num_of_items_callback) (uint8_t scope, bt_bdaddr_t *bd_addr); |
| 411 | |
| 412 | /** Callback for conducting recursive search on a current browsed path for a specified string */ |
| 413 | typedef void (* btrc_search_callback) (uint16_t charset_id, |
| 414 | uint16_t str_len, uint8_t* p_str, bt_bdaddr_t *bd_addr); |
| 415 | |
| 416 | /** Callback to add a specified media item indicated by an identifier to now playing queue. */ |
| 417 | typedef void (* btrc_add_to_now_playing_callback) (uint8_t scope, |
| 418 | uint8_t* uid, uint16_t uid_counter, bt_bdaddr_t *bd_addr); |
| 419 | |
Sanket Agarwal | f65a26b | 2016-07-11 12:08:33 -0700 | [diff] [blame^] | 420 | /** Callback for set addressed player response on TG **/ |
| 421 | typedef void (* btrc_set_addressed_player_callback) (uint16_t player_id, bt_bdaddr_t *bd_addr); |
| 422 | |
| 423 | /** Callback for set browsed player response on TG **/ |
| 424 | typedef void (* btrc_set_browsed_player_callback) (uint16_t player_id, bt_bdaddr_t *bd_addr); |
| 425 | |
| 426 | /** Callback for get folder items on TG |
| 427 | ** num_attr: specifies the number of attributes requested in p_attr_ids |
| 428 | */ |
| 429 | typedef void (* btrc_get_folder_items_callback) (uint8_t scope, uint32_t start_item, |
| 430 | uint32_t end_item, uint8_t num_attr, uint32_t *p_attr_ids, bt_bdaddr_t *bd_addr); |
| 431 | |
| 432 | /** Callback for changing browsed path on TG **/ |
| 433 | typedef void (* btrc_change_path_callback) (uint8_t direction, |
| 434 | uint8_t* folder_uid, bt_bdaddr_t *bd_addr); |
| 435 | |
| 436 | /** Callback to fetch the get item attributes of the media item |
| 437 | ** num_attr: specifies the number of attributes requested in p_attrs |
| 438 | */ |
| 439 | typedef void (* btrc_get_item_attr_callback) (uint8_t scope, uint8_t* uid, uint16_t uid_counter, |
| 440 | uint8_t num_attr, btrc_media_attr_t *p_attrs, bt_bdaddr_t *bd_addr); |
| 441 | |
| 442 | /** Callback for play request for the media item indicated by an identifier */ |
| 443 | typedef void (* btrc_play_item_callback) (uint8_t scope, |
| 444 | uint16_t uid_counter, uint8_t* uid, bt_bdaddr_t *bd_addr); |
| 445 | |
| 446 | /** Callback to fetch total number of items from a folder **/ |
| 447 | typedef void (* btrc_get_total_num_of_items_callback) (uint8_t scope, bt_bdaddr_t *bd_addr); |
| 448 | |
| 449 | /** Callback for conducting recursive search on a current browsed path for a specified string */ |
| 450 | typedef void (* btrc_search_callback) (uint16_t charset_id, |
| 451 | uint16_t str_len, uint8_t* p_str, bt_bdaddr_t *bd_addr); |
| 452 | |
| 453 | /** Callback to add a specified media item indicated by an identifier to now playing queue. */ |
| 454 | typedef void (* btrc_add_to_now_playing_callback) (uint8_t scope, |
| 455 | uint8_t* uid, uint16_t uid_counter, bt_bdaddr_t *bd_addr); |
| 456 | |
Mike Lockwood | 7da4cb8 | 2014-06-02 16:20:51 -0700 | [diff] [blame] | 457 | /** BT-RC Target callback structure. */ |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 458 | typedef struct { |
| 459 | /** set to sizeof(BtRcCallbacks) */ |
| 460 | size_t size; |
Satya Calloji | fe9728d | 2013-08-01 03:11:11 -0700 | [diff] [blame] | 461 | btrc_remote_features_callback remote_features_cb; |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 462 | btrc_get_play_status_callback get_play_status_cb; |
| 463 | btrc_list_player_app_attr_callback list_player_app_attr_cb; |
| 464 | btrc_list_player_app_values_callback list_player_app_values_cb; |
| 465 | btrc_get_player_app_value_callback get_player_app_value_cb; |
| 466 | btrc_get_player_app_attrs_text_callback get_player_app_attrs_text_cb; |
| 467 | btrc_get_player_app_values_text_callback get_player_app_values_text_cb; |
| 468 | btrc_set_player_app_value_callback set_player_app_value_cb; |
| 469 | btrc_get_element_attr_callback get_element_attr_cb; |
| 470 | btrc_register_notification_callback register_notification_cb; |
Satya Calloji | fe9728d | 2013-08-01 03:11:11 -0700 | [diff] [blame] | 471 | btrc_volume_change_callback volume_change_cb; |
John Du | b984481 | 2013-07-23 17:15:34 -0700 | [diff] [blame] | 472 | btrc_passthrough_cmd_callback passthrough_cmd_cb; |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 473 | btrc_set_addressed_player_callback set_addressed_player_cb; |
| 474 | btrc_set_browsed_player_callback set_browsed_player_cb; |
| 475 | btrc_get_folder_items_callback get_folder_items_cb; |
| 476 | btrc_change_path_callback change_path_cb; |
| 477 | btrc_get_item_attr_callback get_item_attr_cb; |
| 478 | btrc_play_item_callback play_item_cb; |
| 479 | btrc_get_total_num_of_items_callback get_total_num_of_items_cb; |
| 480 | btrc_search_callback search_cb; |
| 481 | btrc_add_to_now_playing_callback add_to_now_playing_cb; |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 482 | } btrc_callbacks_t; |
| 483 | |
Mike Lockwood | 7da4cb8 | 2014-06-02 16:20:51 -0700 | [diff] [blame] | 484 | /** Represents the standard BT-RC AVRCP Target interface. */ |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 485 | typedef struct { |
| 486 | |
| 487 | /** set to sizeof(BtRcInterface) */ |
| 488 | size_t size; |
| 489 | /** |
| 490 | * Register the BtRc callbacks |
| 491 | */ |
| 492 | bt_status_t (*init)( btrc_callbacks_t* callbacks ); |
| 493 | |
| 494 | /** Respose to GetPlayStatus request. Contains the current |
| 495 | ** 1. Play status |
| 496 | ** 2. Song duration/length |
| 497 | ** 3. Song position |
| 498 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 499 | bt_status_t (*get_play_status_rsp)( bt_bdaddr_t *bd_addr, btrc_play_status_t play_status, |
| 500 | uint32_t song_len, uint32_t song_pos); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 501 | |
| 502 | /** Lists the support player application attributes (Shuffle/Repeat/...) |
| 503 | ** num_attr: Specifies the number of attributes contained in the pointer p_attrs |
| 504 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 505 | bt_status_t (*list_player_app_attr_rsp)( bt_bdaddr_t *bd_addr, int num_attr, |
| 506 | btrc_player_attr_t *p_attrs); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 507 | |
| 508 | /** Lists the support player application attributes (Shuffle Off/On/Group) |
| 509 | ** num_val: Specifies the number of values contained in the pointer p_vals |
| 510 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 511 | bt_status_t (*list_player_app_value_rsp)( bt_bdaddr_t *bd_addr, int num_val, uint8_t *p_vals); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 512 | |
| 513 | /** Returns the current application attribute values for each of the specified attr_id */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 514 | bt_status_t (*get_player_app_value_rsp)( bt_bdaddr_t *bd_addr, btrc_player_settings_t *p_vals); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 515 | |
| 516 | /** Returns the application attributes text ("Shuffle"/"Repeat"/...) |
| 517 | ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs |
| 518 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 519 | bt_status_t (*get_player_app_attr_text_rsp)( bt_bdaddr_t *bd_addr, int num_attr, |
| 520 | btrc_player_setting_text_t *p_attrs); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 521 | |
| 522 | /** Returns the application attributes text ("Shuffle"/"Repeat"/...) |
| 523 | ** num_attr: Specifies the number of attribute values' text contained in the pointer p_vals |
| 524 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 525 | bt_status_t (*get_player_app_value_text_rsp)( bt_bdaddr_t *bd_addr, int num_val, |
| 526 | btrc_player_setting_text_t *p_vals); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 527 | |
| 528 | /** Returns the current songs' element attributes text ("Title"/"Album"/"Artist") |
| 529 | ** num_attr: Specifies the number of attributes' text contained in the pointer p_attrs |
| 530 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 531 | bt_status_t (*get_element_attr_rsp)( bt_bdaddr_t *bd_addr, uint8_t num_attr, |
| 532 | btrc_element_attr_val_t *p_attrs); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 533 | |
| 534 | /** Response to set player attribute request ("Shuffle"/"Repeat") |
| 535 | ** rsp_status: Status of setting the player attributes for the current media player |
| 536 | */ |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 537 | bt_status_t (*set_player_app_value_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status); |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 538 | |
| 539 | /* Response to the register notification request (Play state change/track change/...). |
| 540 | ** event_id: Refers to the event_id this notification change corresponds too |
| 541 | ** type: Response type - interim/changed |
| 542 | ** p_params: Based on the event_id, this parameter should be populated |
| 543 | */ |
| 544 | bt_status_t (*register_notification_rsp)(btrc_event_id_t event_id, |
| 545 | btrc_notification_type_t type, |
| 546 | btrc_register_notification_t *p_param); |
| 547 | |
Satya Calloji | fe9728d | 2013-08-01 03:11:11 -0700 | [diff] [blame] | 548 | /* AVRCP 1.4 enhancements */ |
| 549 | |
| 550 | /**Send current volume setting to remote side. Support limited to SetAbsoluteVolume |
| 551 | ** This can be enhanced to support Relative Volume (AVRCP 1.0). |
| 552 | ** With RelateVolume, we will send VOLUME_UP/VOLUME_DOWN opposed to absolute volume level |
| 553 | ** volume: Should be in the range 0-127. bit7 is reseved and cannot be set |
| 554 | */ |
| 555 | bt_status_t (*set_volume)(uint8_t volume); |
| 556 | |
Avish Shah | f20c24e | 2016-04-27 21:43:14 +0530 | [diff] [blame] | 557 | /* Set addressed player response from TG to CT */ |
| 558 | bt_status_t (*set_addressed_player_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status); |
| 559 | |
| 560 | /* Set browsed player response from TG to CT */ |
| 561 | bt_status_t (*set_browsed_player_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, |
| 562 | uint32_t num_items, uint16_t charset_id, uint8_t folder_depth, |
| 563 | btrc_br_folder_name_t *p_folders); |
| 564 | |
| 565 | /* Get folder item list response from TG to CT */ |
| 566 | bt_status_t (*get_folder_items_list_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, |
| 567 | uint16_t uid_counter, uint8_t num_items, btrc_folder_items_t *p_items); |
| 568 | |
| 569 | /* Change path response from TG to CT */ |
| 570 | bt_status_t (*change_path_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, |
| 571 | uint32_t num_items); |
| 572 | |
| 573 | /** Returns the element's attributes num_attr: Specifies the number of attributes' text |
| 574 | * contained in the pointer p_attrs |
| 575 | */ |
| 576 | bt_status_t (*get_item_attr_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, |
| 577 | uint8_t num_attr, btrc_element_attr_val_t *p_attrs); |
| 578 | |
| 579 | /* play media item response from TG to CT */ |
| 580 | bt_status_t (*play_item_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status); |
| 581 | |
| 582 | /* get total number of items response from TG to CT*/ |
| 583 | bt_status_t (*get_total_num_of_items_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, |
| 584 | uint32_t uid_counter, uint32_t num_items); |
| 585 | |
| 586 | /* Search VFS response from TG to CT */ |
| 587 | bt_status_t (*search_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status, uint32_t uid_counter, |
| 588 | uint32_t num_items); |
| 589 | |
| 590 | /* add_to_now playing list response from TG to CT */ |
| 591 | bt_status_t (*add_to_now_playing_rsp)(bt_bdaddr_t *bd_addr, btrc_status_t rsp_status); |
| 592 | |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 593 | /** Closes the interface. */ |
| 594 | void (*cleanup)( void ); |
| 595 | } btrc_interface_t; |
| 596 | |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 597 | typedef void (* btrc_passthrough_rsp_callback) (bt_bdaddr_t *bd_addr, int id, int key_state); |
Mike Lockwood | 7da4cb8 | 2014-06-02 16:20:51 -0700 | [diff] [blame] | 598 | |
AnubhavGupta | a5b557a | 2015-09-18 14:34:02 +0530 | [diff] [blame] | 599 | typedef void (* btrc_groupnavigation_rsp_callback) (int id, int key_state); |
| 600 | |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 601 | typedef void (* btrc_connection_state_callback) ( |
| 602 | bool rc_connect, bool bt_connect, bt_bdaddr_t *bd_addr); |
Mike Lockwood | 7da4cb8 | 2014-06-02 16:20:51 -0700 | [diff] [blame] | 603 | |
AnubhavGupta | a5b557a | 2015-09-18 14:34:02 +0530 | [diff] [blame] | 604 | typedef void (* btrc_ctrl_getrcfeatures_callback) (bt_bdaddr_t *bd_addr, int features); |
| 605 | |
| 606 | typedef void (* btrc_ctrl_setabsvol_cmd_callback) (bt_bdaddr_t *bd_addr, uint8_t abs_vol, uint8_t label); |
| 607 | |
| 608 | typedef void (* btrc_ctrl_registernotification_abs_vol_callback) (bt_bdaddr_t *bd_addr, uint8_t label); |
| 609 | |
| 610 | typedef void (* btrc_ctrl_setplayerapplicationsetting_rsp_callback) (bt_bdaddr_t *bd_addr, |
| 611 | uint8_t accepted); |
| 612 | |
| 613 | typedef void (* btrc_ctrl_playerapplicationsetting_callback)(bt_bdaddr_t *bd_addr, |
| 614 | uint8_t num_attr, |
| 615 | btrc_player_app_attr_t *app_attrs, |
| 616 | uint8_t num_ext_attr, |
| 617 | btrc_player_app_ext_attr_t *ext_attrs); |
| 618 | |
| 619 | typedef void (* btrc_ctrl_playerapplicationsetting_changed_callback)(bt_bdaddr_t *bd_addr, |
| 620 | btrc_player_settings_t *p_vals); |
| 621 | |
| 622 | typedef void (* btrc_ctrl_track_changed_callback)(bt_bdaddr_t *bd_addr, uint8_t num_attr, |
| 623 | btrc_element_attr_val_t *p_attrs); |
| 624 | |
| 625 | typedef void (* btrc_ctrl_play_position_changed_callback)(bt_bdaddr_t *bd_addr, |
| 626 | uint32_t song_len, uint32_t song_pos); |
| 627 | |
| 628 | typedef void (* btrc_ctrl_play_status_changed_callback)(bt_bdaddr_t *bd_addr, |
| 629 | btrc_play_status_t play_status); |
| 630 | |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 631 | typedef void (* btrc_ctrl_get_folder_items_callback )(bt_bdaddr_t *bd_addr, |
Sanket Agarwal | f65a26b | 2016-07-11 12:08:33 -0700 | [diff] [blame^] | 632 | btrc_status_t status, |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 633 | const btrc_folder_items_t *folder_items, |
| 634 | uint8_t count); |
| 635 | |
| 636 | typedef void (* btrc_ctrl_change_path_callback)(bt_bdaddr_t *bd_addr, uint8_t count); |
| 637 | |
| 638 | typedef void (* btrc_ctrl_set_browsed_player_callback )( |
| 639 | bt_bdaddr_t *bd_addr, uint8_t num_items, uint8_t depth); |
Mike Lockwood | 7da4cb8 | 2014-06-02 16:20:51 -0700 | [diff] [blame] | 640 | /** BT-RC Controller callback structure. */ |
| 641 | typedef struct { |
| 642 | /** set to sizeof(BtRcCallbacks) */ |
| 643 | size_t size; |
AnubhavGupta | a5b557a | 2015-09-18 14:34:02 +0530 | [diff] [blame] | 644 | btrc_passthrough_rsp_callback passthrough_rsp_cb; |
| 645 | btrc_groupnavigation_rsp_callback groupnavigation_rsp_cb; |
| 646 | btrc_connection_state_callback connection_state_cb; |
| 647 | btrc_ctrl_getrcfeatures_callback getrcfeatures_cb; |
| 648 | btrc_ctrl_setplayerapplicationsetting_rsp_callback setplayerappsetting_rsp_cb; |
| 649 | btrc_ctrl_playerapplicationsetting_callback playerapplicationsetting_cb; |
| 650 | btrc_ctrl_playerapplicationsetting_changed_callback playerapplicationsetting_changed_cb; |
| 651 | btrc_ctrl_setabsvol_cmd_callback setabsvol_cmd_cb; |
| 652 | btrc_ctrl_registernotification_abs_vol_callback registernotification_absvol_cb; |
| 653 | btrc_ctrl_track_changed_callback track_changed_cb; |
| 654 | btrc_ctrl_play_position_changed_callback play_position_changed_cb; |
| 655 | btrc_ctrl_play_status_changed_callback play_status_changed_cb; |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 656 | btrc_ctrl_get_folder_items_callback get_folder_items_cb; |
| 657 | btrc_ctrl_change_path_callback change_folder_path_cb; |
| 658 | btrc_ctrl_set_browsed_player_callback set_browsed_player_cb; |
Mike Lockwood | 7da4cb8 | 2014-06-02 16:20:51 -0700 | [diff] [blame] | 659 | } btrc_ctrl_callbacks_t; |
| 660 | |
| 661 | /** Represents the standard BT-RC AVRCP Controller interface. */ |
| 662 | typedef struct { |
| 663 | |
| 664 | /** set to sizeof(BtRcInterface) */ |
| 665 | size_t size; |
| 666 | /** |
| 667 | * Register the BtRc callbacks |
| 668 | */ |
| 669 | bt_status_t (*init)( btrc_ctrl_callbacks_t* callbacks ); |
| 670 | |
| 671 | /** send pass through command to target */ |
AnubhavGupta | a5b557a | 2015-09-18 14:34:02 +0530 | [diff] [blame] | 672 | bt_status_t (*send_pass_through_cmd) (bt_bdaddr_t *bd_addr, uint8_t key_code, |
| 673 | uint8_t key_state ); |
| 674 | |
| 675 | /** send group navigation command to target */ |
| 676 | bt_status_t (*send_group_navigation_cmd) (bt_bdaddr_t *bd_addr, uint8_t key_code, |
| 677 | uint8_t key_state ); |
| 678 | |
| 679 | /** send command to set player applicaiton setting attributes to target */ |
| 680 | bt_status_t (*set_player_app_setting_cmd) (bt_bdaddr_t *bd_addr, uint8_t num_attrib, |
| 681 | uint8_t* attrib_ids, uint8_t* attrib_vals); |
| 682 | |
Sanket Agarwal | f932776 | 2016-07-11 12:08:33 -0700 | [diff] [blame] | 683 | /** send command to play a particular item */ |
| 684 | bt_status_t (*play_item_cmd) ( |
| 685 | bt_bdaddr_t *bd_addr, uint8_t scope, uint8_t *uid, uint16_t uid_counter); |
| 686 | |
| 687 | /** get the now playing list */ |
| 688 | bt_status_t (*get_now_playing_list_cmd) (bt_bdaddr_t *bd_addr, uint8_t start, uint8_t items); |
| 689 | |
| 690 | /** get the folder list */ |
| 691 | bt_status_t (*get_folder_list_cmd) (bt_bdaddr_t *bd_addr, uint8_t start, uint8_t items); |
| 692 | |
| 693 | /** get the folder list */ |
| 694 | bt_status_t (*get_player_list_cmd) (bt_bdaddr_t *bd_addr, uint8_t start, uint8_t items); |
| 695 | |
| 696 | /** get the folder list */ |
| 697 | bt_status_t (*change_folder_path_cmd) (bt_bdaddr_t *bd_addr, uint8_t direction, uint8_t * uid); |
| 698 | |
| 699 | /** set browsed player */ |
| 700 | bt_status_t (*set_browsed_player_cmd) (bt_bdaddr_t *bd_addr, uint16_t player_id); |
| 701 | |
AnubhavGupta | a5b557a | 2015-09-18 14:34:02 +0530 | [diff] [blame] | 702 | /** send rsp to set_abs_vol received from target */ |
| 703 | bt_status_t (*set_volume_rsp) (bt_bdaddr_t *bd_addr, uint8_t abs_vol, uint8_t label); |
| 704 | |
| 705 | /** send notificaiton rsp for abs vol to target */ |
| 706 | bt_status_t (*register_abs_vol_rsp) (bt_bdaddr_t *bd_addr, btrc_notification_type_t rsp_type, |
| 707 | uint8_t abs_vol, uint8_t label); |
Mike Lockwood | 7da4cb8 | 2014-06-02 16:20:51 -0700 | [diff] [blame] | 708 | |
| 709 | /** Closes the interface. */ |
| 710 | void (*cleanup)( void ); |
| 711 | } btrc_ctrl_interface_t; |
| 712 | |
Ravi Nagarajan | 482ba78 | 2013-02-26 10:34:41 -0800 | [diff] [blame] | 713 | __END_DECLS |
| 714 | |
Satya Calloji | fe9728d | 2013-08-01 03:11:11 -0700 | [diff] [blame] | 715 | #endif /* ANDROID_INCLUDE_BT_RC_H */ |