1 /* 2 * Copyright 2018 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 #pragma once 18 19 #include <vector> 20 21 // AVRCP packets pulled from wireshark 22 namespace { 23 24 // AVRCP Get Capabilities Request packet 25 std::vector<uint8_t> get_capabilities_request = { 26 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x10, 0x00, 0x00, 0x01, 0x03}; 27 28 // AVRCP Get Capabilities Request packet with Company ID 29 std::vector<uint8_t> get_capabilities_request_company_id = { 30 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x10, 0x00, 0x00, 0x01, 0x02}; 31 32 // AVRCP Get Capabilities Request packet with Unknown 33 std::vector<uint8_t> get_capabilities_request_unknown = { 34 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x10, 0x00, 0x00, 0x01, 0x7f}; 35 36 // AVRCP Get Capabilities Response to Company ID request 37 std::vector<uint8_t> get_capabilities_response_company_id = { 38 0x0c, 0x48, 0x00, 0x00, 0x19, 0x58, 0x10, 0x00, 0x00, 39 0x08, 0x02, 0x02, 0x00, 0x19, 0x58, 0x00, 0x23, 0x45}; 40 41 // AVRCP Get Capabilities Response to Events Supported request 42 std::vector<uint8_t> get_capabilities_response_events_supported = { 43 0x0c, 0x48, 0x00, 0x00, 0x19, 0x58, 0x10, 0x00, 44 0x00, 0x05, 0x03, 0x03, 0x01, 0x02, 0x05}; 45 46 // AVRCP Get Element Attributes request for current playing song and attribute 47 // Title 48 std::vector<uint8_t> get_element_attributes_request_partial = { 49 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x20, 0x00, 0x00, 0x0d, 0x00, 0x00, 50 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01}; 51 52 // AVRCP Get Element Attributes request for current playing song and attributes 53 // Title, Artist, Album, Media Number, Playing Time, Total Number of Media, and 54 // Genre 55 std::vector<uint8_t> get_element_attributes_request_full = { 56 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x20, 0x00, 0x00, 0x25, 0x00, 0x00, 57 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 58 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 59 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06}; 60 61 62 // AVRCP Get Element Attributes request for current playing song and attributes 63 // Title, Artist, Album, Media Number, Playing Time, Total Number of Media, 64 // Genre, and Cover Art 65 std::vector<uint8_t> get_element_attributes_request_full_cover_art = { 66 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x20, 0x00, 0x00, 0x29, 0x00, 0x00, 67 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 68 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 69 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 70 0x00, 0x00, 0x08}; 71 72 // AVRCP Get Element Attributes response with attribute values as follows 73 // Title: "Test Song" 74 // Artist: "Test Artist" 75 // Album: "Test Album" 76 // Track Number: "1" 77 // Number of Tracks: "2" 78 // Genre: "Test Genre" 79 // Duration: "1000" 80 std::vector<uint8_t> get_elements_attributes_response_full = { 81 0x0c, 0x48, 0x00, 0x00, 0x19, 0x58, 0x20, 0x00, 0x00, 0x67, 0x07, 0x00, 82 0x00, 0x00, 0x01, 0x00, 0x6a, 0x00, 0x09, 0x54, 0x65, 0x73, 0x74, 0x20, 83 0x53, 0x6f, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x02, 0x00, 0x6a, 0x00, 0x0b, 84 0x54, 0x65, 0x73, 0x74, 0x20, 0x41, 0x72, 0x74, 0x69, 0x73, 0x74, 0x00, 85 0x00, 0x00, 0x03, 0x00, 0x6a, 0x00, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x20, 86 0x41, 0x6c, 0x62, 0x75, 0x6d, 0x00, 0x00, 0x00, 0x04, 0x00, 0x6a, 0x00, 87 0x01, 0x31, 0x00, 0x00, 0x00, 0x05, 0x00, 0x6a, 0x00, 0x01, 0x32, 0x00, 88 0x00, 0x00, 0x06, 0x00, 0x6a, 0x00, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x20, 89 0x47, 0x65, 0x6e, 0x72, 0x65, 0x00, 0x00, 0x00, 0x07, 0x00, 0x6a, 0x00, 90 0x04, 0x31, 0x30, 0x30, 0x30}; 91 92 // AVRCP Get Play Status Request 93 std::vector<uint8_t> get_play_status_request = {0x01, 0x48, 0x00, 0x00, 0x19, 94 0x58, 0x30, 0x00, 0x00, 0x00}; 95 96 // AVRCP Get Play Status Response 97 std::vector<uint8_t> get_play_status_response = { 98 0x0c, 0x48, 0x00, 0x00, 0x19, 0x58, 0x30, 0x00, 0x00, 0x09, 99 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00}; 100 101 // AVRCP List Player Application Setting Attributes Request 102 std::vector<uint8_t> list_player_application_setting_attributes_request = { 103 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x11, 0x00, 0x00, 0x00}; 104 105 // AVRCP List Player Application Setting Attributes Response 106 std::vector<uint8_t> list_player_application_setting_attributes_response = { 107 0x0c, 0x48, 0x00, 0x00, 0x19, 0x58, 0x11, 108 0x00, 0x00, 0x03, 0x02, 0x02, 0x03}; 109 110 // AVRCP List Player Application Setting Attribute Values Request 111 std::vector<uint8_t> list_player_application_setting_attribute_values_request = 112 {0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x12, 0x00, 0x00, 0x01, 0x02}; 113 114 // AVRCP List Player Application Setting Attribute Values - Invalid Setting 115 // Request 116 std::vector<uint8_t> 117 invalid_setting_list_player_application_setting_attribute_values_request = { 118 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x12, 0x00, 0x00, 0x01, 0xff}; 119 120 // AVRCP List Player Application Setting Attribute Values - Invalid Length 121 // Request 122 std::vector<uint8_t> 123 invalid_length_list_player_application_setting_attribute_values_request = { 124 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x12, 0x00, 0x00, 0x00}; 125 126 // AVRCP List Player Application Setting Attribute Values Response 127 std::vector<uint8_t> list_player_application_setting_attribute_values_response = 128 {0x0c, 0x48, 0x00, 0x00, 0x19, 0x58, 0x12, 0x00, 129 0x00, 0x05, 0x04, 0x01, 0x02, 0x03, 0x04}; 130 131 // AVRCP Get Current Player Application Setting Value Request 132 std::vector<uint8_t> get_current_player_application_setting_value_request = { 133 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x13, 134 0x00, 0x00, 0x03, 0x02, 0x02, 0x03}; 135 136 // AVRCP Get Current Player Application Setting Value - Invalid Setting 137 // Request 138 std::vector<uint8_t> 139 invalid_setting_get_current_player_application_setting_value_request = { 140 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x13, 141 0x00, 0x00, 0x03, 0x02, 0x02, 0x7f}; 142 143 // AVRCP Get Current Player Application Setting Value - Invalid Length 144 // Request 145 std::vector<uint8_t> 146 invalid_length_get_current_player_application_setting_value_request = { 147 0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x13, 0x00, 0x00, 0x00}; 148 149 // AVRCP Get Current Player Application Setting Value Response 150 std::vector<uint8_t> get_current_player_application_setting_value_response = { 151 0x0c, 0x48, 0x00, 0x00, 0x19, 0x58, 0x13, 0x00, 152 0x00, 0x05, 0x02, 0x02, 0x01, 0x03, 0x01}; 153 154 // AVRCP Set Player Application Setting Value Request 155 std::vector<uint8_t> set_player_application_setting_value_request = { 156 0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x14, 0x00, 157 0x00, 0x05, 0x02, 0x02, 0x01, 0x03, 0x01}; 158 159 // AVRCP Set Player Application Setting Value Request - Invalid Setting 160 // Request 161 std::vector<uint8_t> 162 invalid_setting_set_player_application_setting_value_request = { 163 0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x14, 0x00, 164 0x00, 0x05, 0x02, 0x02, 0x01, 0x7f, 0x01}; 165 166 // AVRCP Set Player Application Setting Value Request - Invalid Value 167 // Request 168 std::vector<uint8_t> 169 invalid_value_set_player_application_setting_value_request = { 170 0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x14, 0x00, 171 0x00, 0x05, 0x02, 0x02, 0x01, 0x03, 0x7f}; 172 173 // AVRCP Set Player Application Setting Value Request - Invalid Length 174 // Request 175 std::vector<uint8_t> 176 invalid_length_set_player_application_setting_value_request = { 177 0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x14, 0x00, 0x00, 0x00}; 178 179 // AVRCP Set Player Application Setting Value Response 180 std::vector<uint8_t> set_player_application_setting_value_response = { 181 0x09, 0x48, 0x00, 0x00, 0x19, 0x58, 0x14, 0x00, 0x00, 0x00}; 182 183 // AVRCP Pass Through Command Play Pushed Request 184 std::vector<uint8_t> pass_through_command_play_pushed = {0x00, 0x48, 0x7c, 0x44, 185 0x00}; 186 187 // AVRCP Pass Through Command Play Pushed Response 188 std::vector<uint8_t> pass_through_command_play_released = {0x09, 0x48, 0x7c, 189 0xc4, 0x00}; 190 191 // AVRCP Register Playback Status Notification 192 std::vector<uint8_t> register_play_status_notification = { 193 0x03, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 194 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x05}; 195 196 // AVRCP Register Volume Changed Notification 197 std::vector<uint8_t> register_volume_changed_notification = { 198 0x03, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 199 0x00, 0x05, 0x0d, 0x00, 0x00, 0x00, 0x00}; 200 201 // AVRCP Register Notification without any parameter 202 std::vector<uint8_t> register_notification_invalid = {0x03, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 203 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00}; 204 205 // AVRCP Interim Playback Status Notification 206 std::vector<uint8_t> interim_play_status_notification = { 207 0x0f, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 0x00, 0x02, 0x01, 0x00}; 208 209 // AVRCP Interim Track Changed Notification 210 std::vector<uint8_t> interim_track_changed_notification = { 211 0x0f, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 0x00, 0x09, 212 0x02, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08}; 213 214 // AVRCP Changed Playback Position Notification 215 std::vector<uint8_t> changed_play_pos_notification = { 216 0x0d, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 217 0x00, 0x05, 0x05, 0x00, 0x00, 0x00, 0x00}; 218 219 // AVRCP Interim Changed Player Setting Notification 220 std::vector<uint8_t> interim_changed_player_setting_notification = { 221 0x0f, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 0x00, 0x0a, 222 0x08, 0x04, 0x01, 0x01, 0x02, 0x01, 0x03, 0x01, 0x04, 0x01}; 223 224 // AVRCP Changed Player Setting Notification 225 std::vector<uint8_t> changed_player_setting_notification = { 226 0x0d, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 227 0x00, 0x06, 0x08, 0x02, 0x02, 0x01, 0x03, 0x02}; 228 229 // AVRCP Interim Now Playing Changed Notification 230 std::vector<uint8_t> interim_now_playing_notification = { 231 0x0f, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 0x00, 0x01, 0x09}; 232 233 // AVRCP Interim Available Players Changed Notification 234 std::vector<uint8_t> interim_available_players_notification = { 235 0x0f, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 0x00, 0x01, 0x0a}; 236 237 // AVRCP Interim Addressed Player Changed Notification with active 238 // player ID 1 239 std::vector<uint8_t> interim_addressed_player_notification = { 240 0x0f, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 241 0x00, 0x05, 0x0b, 0x00, 0x01, 0x00, 0x00}; 242 243 // AVRCP Interim UIDs Changed Notification 244 std::vector<uint8_t> interim_uids_notificaiton = {0x0f, 0x48, 0x00, 0x00, 0x19, 245 0x58, 0x31, 0x00, 0x00, 0x03, 246 0x0c, 0x00, 0x00}; 247 248 // AVRCP Interim Volume Changed Notification with volume at 55% (0x47) 249 std::vector<uint8_t> interim_volume_changed_notification = { 250 0x0f, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 0x00, 0x02, 0x0d, 0x47}; 251 252 // AVRCP Rejected Volume Changed Notification with volume at 0% 253 std::vector<uint8_t> rejected_volume_changed_notification = { 254 0x0a, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 0x00, 0x02, 0x0d, 0x00}; 255 256 // AVRCP Changed Volume Changed Notification with volume at 55% (0x47) 257 std::vector<uint8_t> changed_volume_changed_notification = { 258 0x0d, 0x48, 0x00, 0x00, 0x19, 0x58, 0x31, 0x00, 0x00, 0x02, 0x0d, 0x47}; 259 260 // AVRCP Reject List Player Application Settings Response 261 std::vector<uint8_t> reject_player_app_settings_response = { 262 0x0a, 0x48, 0x00, 0x00, 0x19, 0x58, 0x11, 0x00, 0x00, 0x01, 0x00}; 263 264 // AVRCP Browse General Reject packet for invalid PDU ID 265 std::vector<uint8_t> general_reject_invalid_command_packet = {0xa0, 0x00, 0x01, 266 0x00}; 267 268 // AVRCP Browse Get Folder Items Request packet for media players with 269 // the following data: 270 // scope = 0x00 (Media Player List) 271 // start_item = 0x00 272 // end_item = 0x03 273 // attributes_requested: all 274 std::vector<uint8_t> get_folder_items_request = {0x71, 0x00, 0x0a, 0x00, 0x00, 275 0x00, 0x00, 0x00, 0x00, 0x00, 276 0x00, 0x03, 0x00}; 277 278 // AVRCP Browse Get Folder Items Request packet for media players with 279 // the following data: 280 // scope = 0x01 (VFS) 281 // start_item = 0x00 282 // end_item = 0x09 283 // attributes_requested: none 284 std::vector<uint8_t> get_folder_items_request_no_attrs = { 285 0x71, 0x00, 0x0a, 0x01, 0x00, 0x00, 0x00, 286 0x00, 0x00, 0x00, 0x00, 0x09, 0xff}; 287 288 // AVRCP Browse Get Folder Items Request packet for media players with 289 // the following data: 290 // scope = 0x01 (VFS) 291 // start_item = 0x00 292 // end_item = 0x09 293 // attributes_requested: Title 294 std::vector<uint8_t> get_folder_items_request_title = { 295 0x71, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 296 0x00, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x1}; 297 298 // AVRCP Browse Get Folder Items Request packet for vfs with 299 // the following data: 300 // scope = 0x01 (VFS) 301 // start_item = 0x00 302 // end_item = 0x05 303 // attributes_requested: TITLE 304 std::vector<uint8_t> get_folder_items_request_vfs = { 305 0x71, 0x00, 0x0e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 306 0x00, 0x00, 0x05, 0x01, 0x00, 0x00, 0x00, 0x01}; 307 308 // AVRCP Browse Get Folder Items Request packet for now playing with 309 // the following data: 310 // scope = 0x03 (Now Playing) 311 // start_item = 0x00 312 // end_item = 0x05 313 // attributes_requested: All Items 314 std::vector<uint8_t> get_folder_items_request_now_playing = {0x71, 0x00, 0x0a, 0x03, 0x00, 0x00, 0x00, 315 0x00, 0x00, 0x00, 0x00, 0x05, 0x00}; 316 317 // AVRCP Browse Get Folder Items Response packet with range out of bounds error 318 std::vector<uint8_t> get_folder_items_error_response = {0x71, 0x00, 0x01, 0x0b}; 319 320 // AVRCP Browse Get Folder Items Response packet for media players 321 // Contains one media player with the following fields: 322 // id = 0x0001 323 // name = "com.google.android.music" 324 // browsing_supported = true 325 std::vector<uint8_t> get_folder_items_media_player_response = { 326 0x71, 0x00, 0x3c, 0x04, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x34, 327 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 328 0x00, 0x00, 0xb7, 0x01, 0x0c, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 329 0x00, 0x00, 0x00, 0x6a, 0x00, 0x18, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 330 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x61, 0x6e, 0x64, 0x72, 0x6f, 331 0x69, 0x64, 0x2e, 0x6d, 0x75, 0x73, 0x69, 0x63}; 332 333 // AVRCP Browse Get Folder Items Response packet with one folder 334 // with the following fields: 335 // uid = 0x0000000000000001 336 // type = 0x00 (Mixed); 337 // name = "Test Folder" 338 // is_playable = true 339 std::vector<uint8_t> get_folder_items_folder_response = { 340 0x71, 0x00, 0x21, 0x04, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x19, 0x00, 341 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x6a, 0x00, 342 0x0b, 0x54, 0x65, 0x73, 0x74, 0x20, 0x46, 0x6f, 0x6c, 0x64, 0x65, 0x72}; 343 344 // AVRCP Browse Get Folder Items Response packet with one song 345 // with the following fields: 346 // uid = 0x0000000000000002 347 // name = "Test Title" 348 // attribute[TITLE] = "Test Title" 349 std::vector<uint8_t> get_folder_items_song_response = { 350 0x71, 0x00, 0x32, 0x04, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x2a, 351 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x6a, 352 0x00, 0x0a, 0x54, 0x65, 0x73, 0x74, 0x20, 0x54, 0x69, 0x74, 0x6c, 353 0x65, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x6a, 0x00, 0x0a, 0x54, 354 0x65, 0x73, 0x74, 0x20, 0x54, 0x69, 0x74, 0x6c, 0x65}; 355 356 // AVRCP Browse Change Path Request down to folder with UID 0x0000000000000002 357 std::vector<uint8_t> change_path_request = {0x72, 0x00, 0x0b, 0x00, 0x00, 358 0x01, 0x00, 0x00, 0x00, 0x00, 359 0x00, 0x00, 0x00, 0x02}; 360 361 // AVRCP Browse Change Path Request up 362 std::vector<uint8_t> change_path_up_request = {0x72, 0x00, 0x0b, 0x00, 0x00, 363 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 364 0xFF, 0xFF, 0xFF, 0xFF}; 365 366 // AVRCP Browse Change Path Response with two items in current folder 367 std::vector<uint8_t> change_path_response = {0x72, 0x00, 0x05, 0x04, 368 0x00, 0x00, 0x00, 0x02}; 369 370 // AVRCP Browse Change Path Response with an error of invalid direction 371 std::vector<uint8_t> change_path_error_response = {0x72, 0x00, 0x01, 0x07}; 372 373 // AVRCP Get Item Attributes request with all attributes requested 374 // with the following fields: 375 // scope = 0x03 (Now Playing List) 376 // uid_counter = 0x0000 377 // uid = 0x0000000000000001 378 std::vector<uint8_t> get_item_attributes_request_all_attributes = { 379 0x73, 0x00, 0x28, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 380 0x01, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 381 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 382 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07}; 383 384 // AVRCP Get Item Attributes request with all attributes requested 385 // with the following fields: 386 // scope = 0x03 (Now Playing List) 387 // uid_counter = 0x0000 388 // uid = 0x0000000000000001 389 // attributes = Title, Artist, Album, Media Number, Playing Time, 390 // Total Number of Media, Genre, and Cover Art 391 std::vector<uint8_t> get_item_attributes_request_all_attributes_with_cover_art = { 392 0x73, 0x00, 0x2C, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 393 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 394 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 395 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07, 0x00, 396 0x00, 0x00, 0x08}; 397 398 // AVRCP Get Item Attributes request with all attributes requested 399 // with the following fields: 400 // scope = 0x03 (Now Playing List) 401 // uid_counter = 0x0001 402 // uid = 0x0000000000000001 403 std::vector<uint8_t> get_item_attributes_request_all_attributes_invalid = { 404 0x73, 0x00, 0x28, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 405 0x01, 0x00, 0x01, 0x07, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 406 0x02, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 407 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x07}; 408 409 // AVRCP Get Item Attributes Response with the following attributes: 410 // title = "Test Song" 411 // artist = "Test Artist" 412 // album = "Test Album" 413 std::vector<uint8_t> get_item_attributes_song_response = { 414 0x73, 0x00, 0x38, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x6a, 0x00, 415 0x09, 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x6f, 0x6e, 0x67, 0x00, 0x00, 416 0x00, 0x02, 0x00, 0x6a, 0x00, 0x0b, 0x54, 0x65, 0x73, 0x74, 0x20, 0x41, 417 0x72, 0x74, 0x69, 0x73, 0x74, 0x00, 0x00, 0x00, 0x03, 0x00, 0x6a, 0x00, 418 0x0a, 0x54, 0x65, 0x73, 0x74, 0x20, 0x41, 0x6c, 0x62, 0x75, 0x6d}; 419 420 // AVRCP Set Addressed Player Request with player_id = 0 421 std::vector<uint8_t> set_addressed_player_request = { 422 0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x60, 0x00, 0x00, 0x02, 0x00, 0x00}; 423 424 // AVRCP Set Addressed Player Request with player_id = 1 425 std::vector<uint8_t> set_addressed_player_id_1_request = { 426 0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x60, 0x00, 0x00, 0x02, 0x00, 0x01}; 427 428 // AVRCP Set Addressed Player Response with status success 429 std::vector<uint8_t> set_addressed_player_response = { 430 0x09, 0x48, 0x00, 0x00, 0x19, 0x58, 0x60, 0x00, 0x00, 0x01, 0x04}; 431 432 // AVRCP Set Browsed Player Request with player_id = 2 433 std::vector<uint8_t> set_browsed_player_request = {0x70, 0x00, 0x02, 0x00, 434 0x02}; 435 436 // AVRCP Set Browsed Player Request with player_id = 0 437 std::vector<uint8_t> set_browsed_player_id_0_request = {0x70, 0x00, 0x02, 0x00, 438 0x00}; 439 440 // AVRCP Set Browsed Player Response with num items = 4 and depth = 0 441 std::vector<uint8_t> set_browsed_player_response = { 442 0x70, 0x00, 0x0a, 0x04, 0x00, 0x00, 0x00, 443 0x00, 0x00, 0x04, 0x00, 0x6a, 0x00}; 444 445 // AVRCP Get Total Number of Items Request with Scope = Media Player List 446 std::vector<uint8_t> get_total_number_of_items_request_media_players = { 447 0x75, 0x00, 0x01, 0x00}; 448 449 // AVRCP Get Total Number of Items Request with Scope = VFS 450 std::vector<uint8_t> get_total_number_of_items_request_vfs = {0x75, 0x00, 0x01, 451 0x01}; 452 453 // AVRCP Get Total Number of Items Request with Scope = Now Playing List 454 std::vector<uint8_t> get_total_number_of_items_request_now_playing = { 455 0x75, 0x00, 0x01, 0x03}; 456 457 // AVRCP Get Total number of Items Response with 5 items in folder 458 std::vector<uint8_t> get_total_number_of_items_response = { 459 0x75, 0x00, 0x07, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05}; 460 461 // AVRCP Play Item Request with scope = Now Playing and 462 // UID = 0x0000000000000003 463 std::vector<uint8_t> play_item_request = { 464 0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x74, 0x00, 0x00, 0x0b, 0x03, 465 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00}; 466 467 // AVRCP Play Item Response 468 std::vector<uint8_t> play_item_response = {0x09, 0x48, 0x00, 0x00, 0x19, 0x58, 469 0x74, 0x00, 0x00, 0x01, 0x04}; 470 471 // AVRCP Set Absolute Volume Request with volume at 56% (0x48) 472 std::vector<uint8_t> set_absolute_volume_request = { 473 0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x50, 0x00, 0x00, 0x01, 0x48}; 474 475 // AVRCP Set Absolute Volume Response with voume at 52% (0x43) 476 std::vector<uint8_t> set_absolute_volume_response = { 477 0x09, 0x48, 0x00, 0x00, 0x19, 0x58, 0x50, 0x00, 0x00, 0x01, 0x43}; 478 479 // Invalid Packets 480 // Short Vendor Packet 481 std::vector<uint8_t> short_vendor_packet = {0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x10, 0x00, 0x00, 0x01}; 482 483 // Short Get Capabilities Request Packet 484 std::vector<uint8_t> short_get_capabilities_request = {0x01, 0x48, 0x00, 0x00, 0x19, 0x58, 0x10, 0x00, 0x00, 0x00}; 485 486 // Short Get Element Attributes Request Packet 487 std::vector<uint8_t> short_get_element_attributes_request = {0x01, 0x48, 0x00, 0x00, 0x19, 488 0x58, 0x20, 0x00, 0x00, 0x00}; 489 490 // Short Play Item Request Packet 491 std::vector<uint8_t> short_play_item_request = {0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x74, 0x00, 0x00, 0x00}; 492 493 // Short Set Addressed Player Request Packet 494 std::vector<uint8_t> short_set_addressed_player_request = {0x00, 0x48, 0x00, 0x00, 0x19, 0x58, 0x60, 0x00, 0x00, 0x00}; 495 496 // Short Browse Packet 497 std::vector<uint8_t> short_browse_packet = {0x71, 0x00, 0x0a}; 498 499 // Short Get Folder Items Request Packet 500 std::vector<uint8_t> short_get_folder_items_request = {0x71, 0x00, 0x00}; 501 502 // Short Get Total Number of Items Request Packet 503 std::vector<uint8_t> short_get_total_number_of_items_request = {0x75, 0x00, 0x00}; 504 505 // Short Change Path Request Packet 506 std::vector<uint8_t> short_change_path_request = {0x72, 0x00, 0x00}; 507 508 // Short Get Item Attributes Request Packet 509 std::vector<uint8_t> short_get_item_attributes_request = {0x73, 0x00, 0x00}; 510 511 } // namespace 512