1 /****************************************************************************** 2 * 3 * Copyright (c) 2014 The Android Open Source Project 4 * Copyright (C) 2009-2012 Broadcom Corporation 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at: 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 ******************************************************************************/ 19 20 /************************************************************************************ 21 * 22 * Filename: btif_util.c 23 * 24 * Description: Miscellaneous helper functions 25 * 26 * 27 ***********************************************************************************/ 28 29 #define LOG_TAG "bt_btif_util" 30 31 #include "btif_util.h" 32 33 #include <assert.h> 34 #include <ctype.h> 35 #include <netinet/in.h> 36 #include <stdio.h> 37 #include <stdlib.h> 38 #include <string.h> 39 40 #include <hardware/bt_av.h> 41 42 #include "avrc_defs.h" 43 #include "bta_ag_api.h" 44 #include "bta_api.h" 45 #include "bta_av_api.h" 46 #include "bta_hf_client_api.h" 47 #include "bta_hh_api.h" 48 #include "bte.h" 49 #include "btif_common.h" 50 #include "btif_dm.h" 51 #include "btu.h" 52 #include "bt_common.h" 53 54 /************************************************************************************ 55 ** Constants & Macros 56 ************************************************************************************/ 57 #define ISDIGIT(a) ((a>='0') && (a<='9')) 58 #define ISXDIGIT(a) (((a>='0') && (a<='9'))||((a>='A') && (a<='F'))||((a>='a') && (a<='f'))) 59 60 /************************************************************************************ 61 ** Local type definitions 62 ************************************************************************************/ 63 64 /************************************************************************************ 65 ** Static variables 66 ************************************************************************************/ 67 68 /************************************************************************************ 69 ** Static functions 70 ************************************************************************************/ 71 72 /************************************************************************************ 73 ** Externs 74 ************************************************************************************/ 75 76 /************************************************************************************ 77 ** Functions 78 ************************************************************************************/ 79 80 /***************************************************************************** 81 ** Logging helper functions 82 *****************************************************************************/ 83 84 UINT32 devclass2uint(DEV_CLASS dev_class) 85 { 86 UINT32 cod = 0; 87 88 if(dev_class != NULL) 89 { 90 /* if COD is 0, irrespective of the device type set it to Unclassified device */ 91 cod = (dev_class[2]) | (dev_class[1] << 8) | (dev_class[0] << 16); 92 } 93 return cod; 94 } 95 void uint2devclass(UINT32 cod, DEV_CLASS dev_class) 96 { 97 dev_class[2] = (UINT8)cod; 98 dev_class[1] = (UINT8)(cod >> 8); 99 dev_class[0] = (UINT8)(cod >> 16); 100 } 101 102 static const UINT8 sdp_base_uuid[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 103 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB}; 104 105 void uuid16_to_uuid128(uint16_t uuid16, bt_uuid_t* uuid128) 106 { 107 uint16_t uuid16_bo; 108 memset(uuid128, 0, sizeof(bt_uuid_t)); 109 110 memcpy(uuid128->uu, sdp_base_uuid, MAX_UUID_SIZE); 111 uuid16_bo = ntohs(uuid16); 112 memcpy(uuid128->uu + 2, &uuid16_bo, sizeof(uint16_t)); 113 } 114 115 bool string_to_uuid(const char *str, bt_uuid_t *p_uuid) 116 { 117 assert(p_uuid); 118 if (str == NULL) 119 return false; 120 121 uint32_t uuid0, uuid4; 122 uint16_t uuid1, uuid2, uuid3, uuid5; 123 124 int rc = sscanf(str, "%08x-%04hx-%04hx-%04hx-%08x%04hx", 125 &uuid0, &uuid1, &uuid2, &uuid3, &uuid4, &uuid5); 126 if (rc != 6) 127 return false; 128 129 uuid0 = htonl(uuid0); 130 uuid1 = htons(uuid1); 131 uuid2 = htons(uuid2); 132 uuid3 = htons(uuid3); 133 uuid4 = htonl(uuid4); 134 uuid5 = htons(uuid5); 135 136 memcpy(&(p_uuid->uu[0]), &uuid0, 4); 137 memcpy(&(p_uuid->uu[4]), &uuid1, 2); 138 memcpy(&(p_uuid->uu[6]), &uuid2, 2); 139 memcpy(&(p_uuid->uu[8]), &uuid3, 2); 140 memcpy(&(p_uuid->uu[10]), &uuid4, 4); 141 memcpy(&(p_uuid->uu[14]), &uuid5, 2); 142 143 return true; 144 } 145 146 void uuid_to_string_legacy(bt_uuid_t *p_uuid, char *str) 147 { 148 uint32_t uuid0, uuid4; 149 uint16_t uuid1, uuid2, uuid3, uuid5; 150 151 memcpy(&uuid0, &(p_uuid->uu[0]), 4); 152 memcpy(&uuid1, &(p_uuid->uu[4]), 2); 153 memcpy(&uuid2, &(p_uuid->uu[6]), 2); 154 memcpy(&uuid3, &(p_uuid->uu[8]), 2); 155 memcpy(&uuid4, &(p_uuid->uu[10]), 4); 156 memcpy(&uuid5, &(p_uuid->uu[14]), 2); 157 158 sprintf((char *)str, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x", 159 ntohl(uuid0), ntohs(uuid1), 160 ntohs(uuid2), ntohs(uuid3), 161 ntohl(uuid4), ntohs(uuid5)); 162 return; 163 } 164 165 /***************************************************************************** 166 ** Function ascii_2_hex 167 ** 168 ** Description This function converts an ASCII string into HEX 169 ** 170 ** Returns the number of hex bytes filled. 171 */ 172 int ascii_2_hex (const char *p_ascii, int len, UINT8 *p_hex) 173 { 174 int x; 175 UINT8 c; 176 177 for (x = 0; (x < len) && (*p_ascii); x++) 178 { 179 if (ISDIGIT (*p_ascii)) 180 c = (*p_ascii - '0') << 4; 181 else 182 c = (toupper(*p_ascii) - 'A' + 10) << 4; 183 184 p_ascii++; 185 if (*p_ascii) 186 { 187 if (ISDIGIT (*p_ascii)) 188 c |= (*p_ascii - '0'); 189 else 190 c |= (toupper(*p_ascii) - 'A' + 10); 191 192 p_ascii++; 193 } 194 *p_hex++ = c; 195 } 196 197 return (x); 198 } 199 200 const char* dump_dm_search_event(UINT16 event) 201 { 202 switch(event) 203 { 204 CASE_RETURN_STR(BTA_DM_INQ_RES_EVT) 205 CASE_RETURN_STR(BTA_DM_INQ_CMPL_EVT) 206 CASE_RETURN_STR(BTA_DM_DISC_RES_EVT) 207 CASE_RETURN_STR(BTA_DM_DISC_BLE_RES_EVT) 208 CASE_RETURN_STR(BTA_DM_DISC_CMPL_EVT) 209 CASE_RETURN_STR(BTA_DM_DI_DISC_CMPL_EVT) 210 CASE_RETURN_STR(BTA_DM_SEARCH_CANCEL_CMPL_EVT) 211 212 default: 213 return "UNKNOWN MSG ID"; 214 } 215 } 216 217 const char* dump_property_type(bt_property_type_t type) 218 { 219 switch(type) 220 { 221 CASE_RETURN_STR(BT_PROPERTY_BDNAME) 222 CASE_RETURN_STR(BT_PROPERTY_BDADDR) 223 CASE_RETURN_STR(BT_PROPERTY_UUIDS) 224 CASE_RETURN_STR(BT_PROPERTY_CLASS_OF_DEVICE) 225 CASE_RETURN_STR(BT_PROPERTY_TYPE_OF_DEVICE) 226 CASE_RETURN_STR(BT_PROPERTY_REMOTE_RSSI) 227 CASE_RETURN_STR(BT_PROPERTY_ADAPTER_DISCOVERY_TIMEOUT) 228 CASE_RETURN_STR(BT_PROPERTY_ADAPTER_BONDED_DEVICES) 229 CASE_RETURN_STR(BT_PROPERTY_ADAPTER_SCAN_MODE) 230 CASE_RETURN_STR(BT_PROPERTY_REMOTE_FRIENDLY_NAME) 231 232 default: 233 return "UNKNOWN PROPERTY ID"; 234 } 235 } 236 237 const char* dump_dm_event(UINT16 event) 238 { 239 switch(event) 240 { 241 CASE_RETURN_STR(BTA_DM_ENABLE_EVT) 242 CASE_RETURN_STR(BTA_DM_DISABLE_EVT) 243 CASE_RETURN_STR(BTA_DM_PIN_REQ_EVT) 244 CASE_RETURN_STR(BTA_DM_AUTH_CMPL_EVT) 245 CASE_RETURN_STR(BTA_DM_AUTHORIZE_EVT) 246 CASE_RETURN_STR(BTA_DM_LINK_UP_EVT) 247 CASE_RETURN_STR(BTA_DM_LINK_DOWN_EVT) 248 CASE_RETURN_STR(BTA_DM_SIG_STRENGTH_EVT) 249 CASE_RETURN_STR(BTA_DM_BUSY_LEVEL_EVT) 250 CASE_RETURN_STR(BTA_DM_BOND_CANCEL_CMPL_EVT) 251 CASE_RETURN_STR(BTA_DM_SP_CFM_REQ_EVT) 252 CASE_RETURN_STR(BTA_DM_SP_KEY_NOTIF_EVT) 253 CASE_RETURN_STR(BTA_DM_SP_RMT_OOB_EVT) 254 CASE_RETURN_STR(BTA_DM_SP_KEYPRESS_EVT) 255 CASE_RETURN_STR(BTA_DM_ROLE_CHG_EVT) 256 CASE_RETURN_STR(BTA_DM_BLE_KEY_EVT) 257 CASE_RETURN_STR(BTA_DM_BLE_SEC_REQ_EVT) 258 CASE_RETURN_STR(BTA_DM_BLE_PASSKEY_NOTIF_EVT) 259 CASE_RETURN_STR(BTA_DM_BLE_PASSKEY_REQ_EVT) 260 CASE_RETURN_STR(BTA_DM_BLE_OOB_REQ_EVT) 261 CASE_RETURN_STR(BTA_DM_BLE_LOCAL_IR_EVT) 262 CASE_RETURN_STR(BTA_DM_BLE_LOCAL_ER_EVT) 263 CASE_RETURN_STR(BTA_DM_BLE_AUTH_CMPL_EVT) 264 CASE_RETURN_STR(BTA_DM_DEV_UNPAIRED_EVT) 265 CASE_RETURN_STR(BTA_DM_HW_ERROR_EVT) 266 CASE_RETURN_STR(BTA_DM_ENER_INFO_READ) 267 268 default: 269 return "UNKNOWN DM EVENT"; 270 } 271 } 272 273 const char* dump_hf_event(UINT16 event) 274 { 275 switch(event) 276 { 277 CASE_RETURN_STR(BTA_AG_ENABLE_EVT) 278 CASE_RETURN_STR(BTA_AG_REGISTER_EVT) 279 CASE_RETURN_STR(BTA_AG_OPEN_EVT) 280 CASE_RETURN_STR(BTA_AG_CLOSE_EVT) 281 CASE_RETURN_STR(BTA_AG_CONN_EVT) 282 CASE_RETURN_STR(BTA_AG_AUDIO_OPEN_EVT) 283 CASE_RETURN_STR(BTA_AG_AUDIO_CLOSE_EVT) 284 CASE_RETURN_STR(BTA_AG_SPK_EVT) 285 CASE_RETURN_STR(BTA_AG_MIC_EVT) 286 CASE_RETURN_STR(BTA_AG_AT_CKPD_EVT) 287 CASE_RETURN_STR(BTA_AG_DISABLE_EVT) 288 #if (BTM_WBS_INCLUDED == TRUE ) 289 CASE_RETURN_STR(BTA_AG_WBS_EVT) 290 #endif 291 CASE_RETURN_STR(BTA_AG_AT_A_EVT) 292 CASE_RETURN_STR(BTA_AG_AT_D_EVT) 293 CASE_RETURN_STR(BTA_AG_AT_CHLD_EVT) 294 CASE_RETURN_STR(BTA_AG_AT_CHUP_EVT) 295 CASE_RETURN_STR(BTA_AG_AT_CIND_EVT) 296 CASE_RETURN_STR(BTA_AG_AT_VTS_EVT) 297 CASE_RETURN_STR(BTA_AG_AT_BINP_EVT) 298 CASE_RETURN_STR(BTA_AG_AT_BLDN_EVT) 299 CASE_RETURN_STR(BTA_AG_AT_BVRA_EVT) 300 CASE_RETURN_STR(BTA_AG_AT_NREC_EVT) 301 CASE_RETURN_STR(BTA_AG_AT_CNUM_EVT) 302 CASE_RETURN_STR(BTA_AG_AT_BTRH_EVT) 303 CASE_RETURN_STR(BTA_AG_AT_CLCC_EVT) 304 CASE_RETURN_STR(BTA_AG_AT_COPS_EVT) 305 CASE_RETURN_STR(BTA_AG_AT_UNAT_EVT) 306 CASE_RETURN_STR(BTA_AG_AT_CBC_EVT) 307 CASE_RETURN_STR(BTA_AG_AT_BAC_EVT) 308 CASE_RETURN_STR(BTA_AG_AT_BCS_EVT) 309 CASE_RETURN_STR(BTA_AG_AT_BIND_EVT) 310 CASE_RETURN_STR(BTA_AG_AT_BIEV_EVT) 311 312 default: 313 return "UNKNOWN MSG ID"; 314 } 315 } 316 317 const char* dump_hf_client_event(UINT16 event) 318 { 319 switch(event) 320 { 321 CASE_RETURN_STR(BTA_HF_CLIENT_ENABLE_EVT) 322 CASE_RETURN_STR(BTA_HF_CLIENT_REGISTER_EVT) 323 CASE_RETURN_STR(BTA_HF_CLIENT_OPEN_EVT) 324 CASE_RETURN_STR(BTA_HF_CLIENT_CLOSE_EVT) 325 CASE_RETURN_STR(BTA_HF_CLIENT_CONN_EVT) 326 CASE_RETURN_STR(BTA_HF_CLIENT_AUDIO_OPEN_EVT) 327 CASE_RETURN_STR(BTA_HF_CLIENT_AUDIO_MSBC_OPEN_EVT) 328 CASE_RETURN_STR(BTA_HF_CLIENT_AUDIO_CLOSE_EVT) 329 CASE_RETURN_STR(BTA_HF_CLIENT_SPK_EVT) 330 CASE_RETURN_STR(BTA_HF_CLIENT_MIC_EVT) 331 CASE_RETURN_STR(BTA_HF_CLIENT_DISABLE_EVT) 332 CASE_RETURN_STR(BTA_HF_CLIENT_IND_EVT) 333 CASE_RETURN_STR(BTA_HF_CLIENT_VOICE_REC_EVT) 334 CASE_RETURN_STR(BTA_HF_CLIENT_OPERATOR_NAME_EVT) 335 CASE_RETURN_STR(BTA_HF_CLIENT_CLIP_EVT) 336 CASE_RETURN_STR(BTA_HF_CLIENT_CCWA_EVT) 337 CASE_RETURN_STR(BTA_HF_CLIENT_AT_RESULT_EVT) 338 CASE_RETURN_STR(BTA_HF_CLIENT_CLCC_EVT) 339 CASE_RETURN_STR(BTA_HF_CLIENT_CNUM_EVT) 340 CASE_RETURN_STR(BTA_HF_CLIENT_BTRH_EVT) 341 CASE_RETURN_STR(BTA_HF_CLIENT_BSIR_EVT) 342 CASE_RETURN_STR(BTA_HF_CLIENT_BINP_EVT) 343 CASE_RETURN_STR(BTA_HF_CLIENT_RING_INDICATION) 344 default: 345 return "UNKNOWN MSG ID"; 346 } 347 } 348 349 const char* dump_hh_event(UINT16 event) 350 { 351 switch(event) 352 { 353 CASE_RETURN_STR(BTA_HH_ENABLE_EVT) 354 CASE_RETURN_STR(BTA_HH_DISABLE_EVT) 355 CASE_RETURN_STR(BTA_HH_OPEN_EVT) 356 CASE_RETURN_STR(BTA_HH_CLOSE_EVT) 357 CASE_RETURN_STR(BTA_HH_GET_DSCP_EVT) 358 CASE_RETURN_STR(BTA_HH_GET_PROTO_EVT) 359 CASE_RETURN_STR(BTA_HH_GET_RPT_EVT) 360 CASE_RETURN_STR(BTA_HH_GET_IDLE_EVT) 361 CASE_RETURN_STR(BTA_HH_SET_PROTO_EVT) 362 CASE_RETURN_STR(BTA_HH_SET_RPT_EVT) 363 CASE_RETURN_STR(BTA_HH_SET_IDLE_EVT) 364 CASE_RETURN_STR(BTA_HH_VC_UNPLUG_EVT) 365 CASE_RETURN_STR(BTA_HH_ADD_DEV_EVT) 366 CASE_RETURN_STR(BTA_HH_RMV_DEV_EVT) 367 CASE_RETURN_STR(BTA_HH_API_ERR_EVT) 368 default: 369 return "UNKNOWN MSG ID"; 370 } 371 } 372 373 const char* dump_hf_conn_state(UINT16 event) 374 { 375 switch(event) 376 { 377 CASE_RETURN_STR(BTHF_CONNECTION_STATE_DISCONNECTED) 378 CASE_RETURN_STR(BTHF_CONNECTION_STATE_CONNECTING) 379 CASE_RETURN_STR(BTHF_CONNECTION_STATE_CONNECTED) 380 CASE_RETURN_STR(BTHF_CONNECTION_STATE_SLC_CONNECTED) 381 CASE_RETURN_STR(BTHF_CONNECTION_STATE_DISCONNECTING) 382 default: 383 return "UNKNOWN MSG ID"; 384 } 385 } 386 387 const char* dump_hf_call_state(bthf_call_state_t call_state) 388 { 389 switch(call_state) 390 { 391 CASE_RETURN_STR(BTHF_CALL_STATE_IDLE) 392 CASE_RETURN_STR(BTHF_CALL_STATE_HELD) 393 CASE_RETURN_STR(BTHF_CALL_STATE_DIALING) 394 CASE_RETURN_STR(BTHF_CALL_STATE_ALERTING) 395 CASE_RETURN_STR(BTHF_CALL_STATE_INCOMING) 396 CASE_RETURN_STR(BTHF_CALL_STATE_WAITING) 397 CASE_RETURN_STR(BTHF_CALL_STATE_ACTIVE) 398 default: 399 return "UNKNOWN CALL STATE"; 400 } 401 } 402 403 const char* dump_thread_evt(bt_cb_thread_evt evt) 404 { 405 switch(evt) 406 { 407 CASE_RETURN_STR(ASSOCIATE_JVM) 408 CASE_RETURN_STR(DISASSOCIATE_JVM) 409 410 default: 411 return "unknown thread evt"; 412 } 413 } 414 415 const char* dump_hf_audio_state(UINT16 event) 416 { 417 switch(event) 418 { 419 CASE_RETURN_STR(BTHF_AUDIO_STATE_DISCONNECTED) 420 CASE_RETURN_STR(BTHF_AUDIO_STATE_CONNECTING) 421 CASE_RETURN_STR(BTHF_AUDIO_STATE_CONNECTED) 422 CASE_RETURN_STR(BTHF_AUDIO_STATE_DISCONNECTING) 423 default: 424 return "UNKNOWN MSG ID"; 425 426 } 427 } 428 429 const char* dump_av_conn_state(UINT16 event) 430 { 431 switch(event) 432 { 433 CASE_RETURN_STR(BTAV_CONNECTION_STATE_DISCONNECTED) 434 CASE_RETURN_STR(BTAV_CONNECTION_STATE_CONNECTING) 435 CASE_RETURN_STR(BTAV_CONNECTION_STATE_CONNECTED) 436 CASE_RETURN_STR(BTAV_CONNECTION_STATE_DISCONNECTING) 437 default: 438 return "UNKNOWN MSG ID"; 439 } 440 } 441 442 const char* dump_av_audio_state(UINT16 event) 443 { 444 switch(event) 445 { 446 CASE_RETURN_STR(BTAV_AUDIO_STATE_REMOTE_SUSPEND) 447 CASE_RETURN_STR(BTAV_AUDIO_STATE_STOPPED) 448 CASE_RETURN_STR(BTAV_AUDIO_STATE_STARTED) 449 default: 450 return "UNKNOWN MSG ID"; 451 } 452 } 453 454 const char* dump_adapter_scan_mode(bt_scan_mode_t mode) 455 { 456 switch(mode) 457 { 458 CASE_RETURN_STR(BT_SCAN_MODE_NONE) 459 CASE_RETURN_STR(BT_SCAN_MODE_CONNECTABLE) 460 CASE_RETURN_STR(BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE) 461 462 default: 463 return "unknown scan mode"; 464 } 465 } 466 467 const char* dump_bt_status(bt_status_t status) 468 { 469 switch(status) 470 { 471 CASE_RETURN_STR(BT_STATUS_SUCCESS) 472 CASE_RETURN_STR(BT_STATUS_FAIL) 473 CASE_RETURN_STR(BT_STATUS_NOT_READY) 474 CASE_RETURN_STR(BT_STATUS_NOMEM) 475 CASE_RETURN_STR(BT_STATUS_BUSY) 476 CASE_RETURN_STR(BT_STATUS_UNSUPPORTED) 477 478 default: 479 return "unknown scan mode"; 480 } 481 } 482 483 const char *dump_rc_event(UINT8 event) 484 { 485 switch(event) { 486 CASE_RETURN_STR(BTA_AV_RC_OPEN_EVT) 487 CASE_RETURN_STR(BTA_AV_RC_CLOSE_EVT) 488 CASE_RETURN_STR(BTA_AV_REMOTE_CMD_EVT) 489 CASE_RETURN_STR(BTA_AV_REMOTE_RSP_EVT) 490 CASE_RETURN_STR(BTA_AV_VENDOR_CMD_EVT) 491 CASE_RETURN_STR(BTA_AV_VENDOR_RSP_EVT) 492 CASE_RETURN_STR(BTA_AV_META_MSG_EVT) 493 CASE_RETURN_STR(BTA_AV_RC_FEAT_EVT) 494 default: 495 return "UNKNOWN_EVENT"; 496 } 497 } 498 499 const char * dump_rc_notification_event_id(UINT8 event_id) 500 { 501 switch(event_id) 502 { 503 CASE_RETURN_STR(AVRC_EVT_PLAY_STATUS_CHANGE) 504 CASE_RETURN_STR(AVRC_EVT_TRACK_CHANGE) 505 CASE_RETURN_STR(AVRC_EVT_TRACK_REACHED_END) 506 CASE_RETURN_STR(AVRC_EVT_TRACK_REACHED_START) 507 CASE_RETURN_STR(AVRC_EVT_PLAY_POS_CHANGED) 508 CASE_RETURN_STR(AVRC_EVT_BATTERY_STATUS_CHANGE) 509 CASE_RETURN_STR(AVRC_EVT_SYSTEM_STATUS_CHANGE) 510 CASE_RETURN_STR(AVRC_EVT_APP_SETTING_CHANGE) 511 CASE_RETURN_STR(AVRC_EVT_VOLUME_CHANGE) 512 513 default: 514 return "Unhandled Event ID"; 515 } 516 } 517 518 const char* dump_rc_pdu(UINT8 pdu) 519 { 520 switch(pdu) 521 { 522 CASE_RETURN_STR(AVRC_PDU_LIST_PLAYER_APP_ATTR) 523 CASE_RETURN_STR(AVRC_PDU_LIST_PLAYER_APP_VALUES) 524 CASE_RETURN_STR(AVRC_PDU_GET_CUR_PLAYER_APP_VALUE) 525 CASE_RETURN_STR(AVRC_PDU_SET_PLAYER_APP_VALUE) 526 CASE_RETURN_STR(AVRC_PDU_GET_PLAYER_APP_ATTR_TEXT) 527 CASE_RETURN_STR(AVRC_PDU_GET_PLAYER_APP_VALUE_TEXT) 528 CASE_RETURN_STR(AVRC_PDU_INFORM_DISPLAY_CHARSET) 529 CASE_RETURN_STR(AVRC_PDU_INFORM_BATTERY_STAT_OF_CT) 530 CASE_RETURN_STR(AVRC_PDU_GET_ELEMENT_ATTR) 531 CASE_RETURN_STR(AVRC_PDU_GET_PLAY_STATUS) 532 CASE_RETURN_STR(AVRC_PDU_REGISTER_NOTIFICATION) 533 CASE_RETURN_STR(AVRC_PDU_REQUEST_CONTINUATION_RSP) 534 CASE_RETURN_STR(AVRC_PDU_ABORT_CONTINUATION_RSP) 535 CASE_RETURN_STR(AVRC_PDU_SET_ABSOLUTE_VOLUME) 536 CASE_RETURN_STR(AVRC_PDU_SET_ADDRESSED_PLAYER) 537 CASE_RETURN_STR(AVRC_PDU_CHANGE_PATH) 538 CASE_RETURN_STR(AVRC_PDU_GET_CAPABILITIES) 539 default: 540 return "Unknown PDU"; 541 } 542 } 543