1 /****************************************************************************** 2 * 3 * Copyright (C) 2006-2012 Broadcom Corporation 4 * 5 * Licensed under the Apache License, Version 2.0 (the "License"); 6 * you may not use this file except in compliance with the License. 7 * You may obtain a copy of the License at: 8 * 9 * http://www.apache.org/licenses/LICENSE-2.0 10 * 11 * Unless required by applicable law or agreed to in writing, software 12 * distributed under the License is distributed on an "AS IS" BASIS, 13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 * See the License for the specific language governing permissions and 15 * limitations under the License. 16 * 17 ******************************************************************************/ 18 19 /****************************************************************************** 20 * 21 * nterface to AVRCP Application Programming Interface 22 * 23 ******************************************************************************/ 24 #ifndef AVRC_API_H 25 #define AVRC_API_H 26 #include "common/bt_target.h" 27 #include "common/bt_defs.h" 28 #include "stack/avct_api.h" 29 #include "stack/sdp_api.h" 30 #include "stack/avrc_defs.h" 31 #if (AVRC_INCLUDED == TRUE) 32 /***************************************************************************** 33 ** constants 34 *****************************************************************************/ 35 36 /* API function return value result codes. */ 37 #define AVRC_SUCCESS AVCT_SUCCESS /* 0 Function successful */ 38 #define AVRC_NO_RESOURCES AVCT_NO_RESOURCES /* 1 Not enough resources */ 39 #define AVRC_BAD_HANDLE AVCT_BAD_HANDLE /* 2 Bad handle */ 40 #define AVRC_PID_IN_USE AVCT_PID_IN_USE /* 3 PID already in use */ 41 #define AVRC_NOT_OPEN AVCT_NOT_OPEN /* 4 Connection not open */ 42 #define AVRC_MSG_TOO_BIG 5 /* 5 the message length exceed the MTU of the browsing channel */ 43 #define AVRC_FAIL 0x10 /* 0x10 generic failure */ 44 #define AVRC_BAD_PARAM 0x11 /* 0x11 bad parameter */ 45 46 /* Control role - same as AVCT_TARGET/AVCT_CONTROL */ 47 #define AVRC_CT_TARGET 1 /* target */ 48 #define AVRC_CT_CONTROL 2 /* controller */ 49 #define AVRC_CT_PASSIVE 4 /* If conflict, allow the other side to succeed */ 50 51 /* Connection role */ 52 #define AVRC_CONN_INT AVCT_INT /* initiator */ 53 #define AVRC_CONN_ACP AVCT_ACP /* Acceptor */ 54 55 56 /* AVRC CTRL events */ 57 /* AVRC_OPEN_IND_EVT event is sent when the connection is successfully opened. 58 * This eventis sent in response to an AVRC_Open(). */ 59 #define AVRC_OPEN_IND_EVT 0 60 61 /* AVRC_CLOSE_IND_EVT event is sent when a connection is closed. 62 * This event can result from a call to AVRC_Close() or when the peer closes 63 * the connection. It is also sent when a connection attempted through 64 * AVRC_Open() fails. */ 65 #define AVRC_CLOSE_IND_EVT 1 66 67 /* AVRC_CONG_IND_EVT event indicates that AVCTP is congested and cannot send 68 * any more messages. */ 69 #define AVRC_CONG_IND_EVT 2 70 71 /* AVRC_UNCONG_IND_EVT event indicates that AVCTP is uncongested and ready to 72 * send messages. */ 73 #define AVRC_UNCONG_IND_EVT 3 74 75 /* AVRC_BROWSE_OPEN_IND_EVT event is sent when the browse channel is successfully opened. 76 * This eventis sent in response to an AVRC_Open() or AVRC_OpenBrowse() . */ 77 #define AVRC_BROWSE_OPEN_IND_EVT 4 78 79 /* AVRC_BROWSE_CLOSE_IND_EVT event is sent when a browse channel is closed. 80 * This event can result from a call to AVRC_Close(), AVRC_CloseBrowse() or when the peer closes 81 * the connection. It is also sent when a connection attempted through 82 * AVRC_OpenBrowse() fails. */ 83 #define AVRC_BROWSE_CLOSE_IND_EVT 5 84 85 /* AVRC_BROWSE_CONG_IND_EVT event indicates that AVCTP browse channel is congested and cannot send 86 * any more messages. */ 87 #define AVRC_BROWSE_CONG_IND_EVT 6 88 89 /* AVRC_BROWSE_UNCONG_IND_EVT event indicates that AVCTP browse channel is uncongested and ready to 90 * send messages. */ 91 #define AVRC_BROWSE_UNCONG_IND_EVT 7 92 93 /* AVRC_CMD_TIMEOUT_EVT event indicates timeout waiting for AVRC command response from the peer */ 94 #define AVRC_CMD_TIMEOUT_EVT 8 95 96 /* Supported categories */ 97 #define AVRC_SUPF_CT_CAT1 0x0001 /* Category 1 */ 98 #define AVRC_SUPF_CT_CAT2 0x0002 /* Category 2 */ 99 #define AVRC_SUPF_CT_CAT3 0x0004 /* Category 3 */ 100 #define AVRC_SUPF_CT_CAT4 0x0008 /* Category 4 */ 101 #define AVRC_SUPF_CT_BROWSE 0x0040 /* Browsing */ 102 103 #define AVRC_SUPF_TG_CAT1 0x0001 /* Category 1 */ 104 #define AVRC_SUPF_TG_CAT2 0x0002 /* Category 2 */ 105 #define AVRC_SUPF_TG_CAT3 0x0004 /* Category 3 */ 106 #define AVRC_SUPF_TG_CAT4 0x0008 /* Category 4 */ 107 #define AVRC_SUPF_TG_APP_SETTINGS 0x0010 /* Player Application Settings */ 108 #define AVRC_SUPF_TG_GROUP_NAVI 0x0020 /* Group Navigation */ 109 #define AVRC_SUPF_TG_BROWSE 0x0040 /* Browsing */ 110 #define AVRC_SUPF_TG_MULTI_PLAYER 0x0080 /* Muliple Media Player */ 111 112 #define AVRC_META_SUCCESS AVRC_SUCCESS 113 #define AVRC_META_FAIL AVRC_FAIL 114 #define AVRC_METADATA_CMD 0x0000 115 #define AVRC_METADATA_RESP 0x0001 116 117 118 119 /***************************************************************************** 120 ** data type definitions 121 *****************************************************************************/ 122 123 /* This data type is used in AVRC_FindService() to initialize the SDP database 124 * to hold the result service search. */ 125 typedef struct { 126 UINT32 db_len; /* Length, in bytes, of the discovery database */ 127 tSDP_DISCOVERY_DB *p_db; /* Pointer to the discovery database */ 128 UINT16 num_attr;/* The number of attributes in p_attrs */ 129 UINT16 *p_attrs; /* The attributes filter. If NULL, AVRCP API sets the attribute filter 130 * to be ATTR_ID_SERVICE_CLASS_ID_LIST, ATTR_ID_BT_PROFILE_DESC_LIST, 131 * ATTR_ID_SUPPORTED_FEATURES, ATTR_ID_SERVICE_NAME and ATTR_ID_PROVIDER_NAME. 132 * If not NULL, the input is taken as the filter. */ 133 } tAVRC_SDP_DB_PARAMS; 134 135 /* This callback function returns service discovery information to the 136 * application after the AVRC_FindService() API function is called. The 137 * implementation of this callback function must copy the p_service_name 138 * and p_provider_name parameters passed to it as they are not guaranteed 139 * to remain after the callback function exits. */ 140 typedef void (tAVRC_FIND_CBACK) (UINT16 status); 141 142 143 /* This is the control callback function. This function passes events 144 * listed in Table 20 to the application. */ 145 typedef void (tAVRC_CTRL_CBACK) (UINT8 handle, UINT8 event, UINT16 result, 146 BD_ADDR peer_addr); 147 148 149 /* This is the message callback function. It is executed when AVCTP has 150 * a message packet ready for the application. The implementation of this 151 * callback function must copy the tAVRC_MSG structure passed to it as it 152 * is not guaranteed to remain after the callback function exits. */ 153 typedef void (tAVRC_MSG_CBACK) (UINT8 handle, UINT8 label, UINT8 opcode, 154 tAVRC_MSG *p_msg); 155 156 typedef struct { 157 tAVRC_CTRL_CBACK *p_ctrl_cback; /* pointer to application control callback */ 158 tAVRC_MSG_CBACK *p_msg_cback; /* pointer to application message callback */ 159 UINT32 company_id; /* the company ID */ 160 UINT8 conn; /* Connection role (Initiator/acceptor) */ 161 UINT8 control; /* Control role (Control/Target) */ 162 } tAVRC_CONN_CB; 163 164 165 166 /***************************************************************************** 167 ** external function declarations 168 *****************************************************************************/ 169 #ifdef __cplusplus 170 extern "C" 171 { 172 #endif 173 174 /****************************************************************************** 175 ** 176 ** Function AVRC_AddRecord 177 ** 178 ** Description This function is called to build an AVRCP SDP record. 179 ** Prior to calling this function the application must 180 ** call SDP_CreateRecord() to create an SDP record. 181 ** 182 ** Input Parameters: 183 ** service_uuid: Indicates TG(UUID_SERVCLASS_AV_REM_CTRL_TARGET) 184 ** or CT(UUID_SERVCLASS_AV_REMOTE_CONTROL) 185 ** 186 ** p_service_name: Pointer to a null-terminated character 187 ** string containing the service name. 188 ** If service name is not used set this to NULL. 189 ** 190 ** p_provider_name: Pointer to a null-terminated character 191 ** string containing the provider name. 192 ** If provider name is not used set this to NULL. 193 ** 194 ** categories: Supported categories. 195 ** 196 ** sdp_handle: SDP handle returned by SDP_CreateRecord(). 197 ** 198 ** browsing_en: Supported browsing 199 ** 200 ** Output Parameters: 201 ** None. 202 ** 203 ** Returns AVRC_SUCCESS if successful. 204 ** AVRC_NO_RESOURCES if not enough resources to build the SDP record. 205 ** 206 ******************************************************************************/ 207 extern UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, char *p_provider_name, 208 UINT16 categories, UINT32 sdp_handle, BOOLEAN browsing_en); 209 210 /****************************************************************************** 211 ** 212 ** Function AVRC_FindService 213 ** 214 ** Description This function is called by the application to perform service 215 ** discovery and retrieve AVRCP SDP record information from a 216 ** peer device. Information is returned for the first service 217 ** record found on the server that matches the service UUID. 218 ** The callback function will be executed when service discovery 219 ** is complete. There can only be one outstanding call to 220 ** AVRC_FindService() at a time; the application must wait for 221 ** the callback before it makes another call to the function. 222 ** The application is responsible for allocating memory for the 223 ** discovery database. It is recommended that the size of the 224 ** discovery database be at least 300 bytes. The application 225 ** can deallocate the memory after the callback function has 226 ** executed. 227 ** 228 ** Input Parameters: 229 ** service_uuid: Indicates TG(UUID_SERVCLASS_AV_REM_CTRL_TARGET) 230 ** or CT(UUID_SERVCLASS_AV_REMOTE_CONTROL) 231 ** 232 ** bd_addr: BD address of the peer device. 233 ** 234 ** p_db: SDP discovery database parameters. 235 ** 236 ** p_cback: Pointer to the callback function. 237 ** 238 ** Output Parameters: 239 ** None. 240 ** 241 ** Returns AVRC_SUCCESS if successful. 242 ** AVRC_BAD_PARAMS if discovery database parameters are invalid. 243 ** AVRC_NO_RESOURCES if there are not enough resources to 244 ** perform the service search. 245 ** 246 ******************************************************************************/ 247 extern UINT16 AVRC_FindService(UINT16 service_uuid, BD_ADDR bd_addr, 248 tAVRC_SDP_DB_PARAMS *p_db, tAVRC_FIND_CBACK *p_cback); 249 250 /****************************************************************************** 251 ** 252 ** Function AVRC_Open 253 ** 254 ** Description This function is called to open a connection to AVCTP. 255 ** The connection can be either an initiator or acceptor, as 256 ** determined by the p_ccb->stream parameter. 257 ** The connection can be a target, a controller or for both role, 258 ** as determined by the p_ccb->control parameter. 259 ** By definition, a target connection is an acceptor connection 260 ** that waits for an incoming AVCTP connection from the peer. 261 ** The connection remains available to the application until 262 ** the application closes it by calling AVRC_Close(). The 263 ** application does not need to reopen the connection after an 264 ** AVRC_CLOSE_IND_EVT is received. 265 ** 266 ** Input Parameters: 267 ** p_ccb->company_id: Company Identifier. 268 ** 269 ** p_ccb->p_ctrl_cback: Pointer to control callback function. 270 ** 271 ** p_ccb->p_msg_cback: Pointer to message callback function. 272 ** 273 ** p_ccb->conn: AVCTP connection role. This is set to 274 ** AVCTP_INT for initiator connections and AVCTP_ACP 275 ** for acceptor connections. 276 ** 277 ** p_ccb->control: Control role. This is set to 278 ** AVRC_CT_TARGET for target connections, AVRC_CT_CONTROL 279 ** for control connections or (AVRC_CT_TARGET|AVRC_CT_CONTROL) 280 ** for connections that support both roles. 281 ** 282 ** peer_addr: BD address of peer device. This value is 283 ** only used for initiator connections; for acceptor 284 ** connections it can be set to NULL. 285 ** 286 ** Output Parameters: 287 ** p_handle: Pointer to handle. This parameter is only 288 ** valid if AVRC_SUCCESS is returned. 289 ** 290 ** Returns AVRC_SUCCESS if successful. 291 ** AVRC_NO_RESOURCES if there are not enough resources to open 292 ** the connection. 293 ** 294 ******************************************************************************/ 295 extern UINT16 AVRC_Open(UINT8 *p_handle, tAVRC_CONN_CB *p_ccb, 296 BD_ADDR_PTR peer_addr); 297 298 /****************************************************************************** 299 ** 300 ** Function AVRC_Close 301 ** 302 ** Description Close a connection opened with AVRC_Open(). 303 ** This function is called when the 304 ** application is no longer using a connection. 305 ** 306 ** Input Parameters: 307 ** handle: Handle of this connection. 308 ** 309 ** Output Parameters: 310 ** None. 311 ** 312 ** Returns AVRC_SUCCESS if successful. 313 ** AVRC_BAD_HANDLE if handle is invalid. 314 ** 315 ******************************************************************************/ 316 extern UINT16 AVRC_Close(UINT8 handle); 317 318 /****************************************************************************** 319 ** 320 ** Function AVRC_OpenBrowse 321 ** 322 ** Description This function is called to open a browsing connection to AVCTP. 323 ** The connection can be either an initiator or acceptor, as 324 ** determined by the conn_role. 325 ** The handle is returned by a previous call to AVRC_Open. 326 ** 327 ** Returns AVRC_SUCCESS if successful. 328 ** AVRC_NO_RESOURCES if there are not enough resources to open 329 ** the connection. 330 ** 331 ******************************************************************************/ 332 extern UINT16 AVRC_OpenBrowse(UINT8 handle, UINT8 conn_role); 333 334 /****************************************************************************** 335 ** 336 ** Function AVRC_CloseBrowse 337 ** 338 ** Description Close a connection opened with AVRC_OpenBrowse(). 339 ** This function is called when the 340 ** application is no longer using a connection. 341 ** 342 ** Returns AVRC_SUCCESS if successful. 343 ** AVRC_BAD_HANDLE if handle is invalid. 344 ** 345 ******************************************************************************/ 346 extern UINT16 AVRC_CloseBrowse(UINT8 handle); 347 348 /****************************************************************************** 349 ** 350 ** Function AVRC_MsgReq 351 ** 352 ** Description This function is used to send the AVRCP byte stream in p_pkt 353 ** down to AVCTP. 354 ** 355 ** It is expected that p_pkt->offset is at least AVCT_MSG_OFFSET 356 ** p_pkt->layer_specific is AVCT_DATA_CTRL or AVCT_DATA_BROWSE 357 ** p_pkt->event is AVRC_OP_VENDOR, AVRC_OP_PASS_THRU or AVRC_OP_BROWSING 358 ** The above BT_HDR settings are set by the AVRC_Bld* functions. 359 ** 360 ** Returns AVRC_SUCCESS if successful. 361 ** AVRC_BAD_HANDLE if handle is invalid. 362 ** 363 ******************************************************************************/ 364 extern UINT16 AVRC_MsgReq (UINT8 handle, UINT8 label, UINT8 ctype, BT_HDR *p_pkt); 365 366 /****************************************************************************** 367 ** 368 ** Function AVRC_UnitCmd 369 ** 370 ** Description Send a UNIT INFO command to the peer device. This 371 ** function can only be called for controller role connections. 372 ** Any response message from the peer is passed back through 373 ** the tAVRC_MSG_CBACK callback function. 374 ** 375 ** Input Parameters: 376 ** handle: Handle of this connection. 377 ** 378 ** label: Transaction label. 379 ** 380 ** Output Parameters: 381 ** None. 382 ** 383 ** Returns AVRC_SUCCESS if successful. 384 ** AVRC_BAD_HANDLE if handle is invalid. 385 ** 386 ******************************************************************************/ 387 extern UINT16 AVRC_UnitCmd(UINT8 handle, UINT8 label); 388 389 /****************************************************************************** 390 ** 391 ** Function AVRC_SubCmd 392 ** 393 ** Description Send a SUBUNIT INFO command to the peer device. This 394 ** function can only be called for controller role connections. 395 ** Any response message from the peer is passed back through 396 ** the tAVRC_MSG_CBACK callback function. 397 ** 398 ** Input Parameters: 399 ** handle: Handle of this connection. 400 ** 401 ** label: Transaction label. 402 ** 403 ** page: Specifies which part of the subunit type table 404 ** is requested. For AVRCP it is typically zero. 405 ** Value range is 0-7. 406 ** 407 ** Output Parameters: 408 ** None. 409 ** 410 ** Returns AVRC_SUCCESS if successful. 411 ** AVRC_BAD_HANDLE if handle is invalid. 412 ** 413 ******************************************************************************/ 414 extern UINT16 AVRC_SubCmd(UINT8 handle, UINT8 label, UINT8 page); 415 416 417 /****************************************************************************** 418 ** 419 ** Function AVRC_PassCmd 420 ** 421 ** Description Send a PASS THROUGH command to the peer device. This 422 ** function can only be called for controller role connections. 423 ** Any response message from the peer is passed back through 424 ** the tAVRC_MSG_CBACK callback function. 425 ** 426 ** Input Parameters: 427 ** handle: Handle of this connection. 428 ** 429 ** label: Transaction label. 430 ** 431 ** p_msg: Pointer to PASS THROUGH message structure. 432 ** 433 ** Output Parameters: 434 ** None. 435 ** 436 ** Returns AVRC_SUCCESS if successful. 437 ** AVRC_BAD_HANDLE if handle is invalid. 438 ** 439 ******************************************************************************/ 440 extern UINT16 AVRC_PassCmd(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg); 441 442 /****************************************************************************** 443 ** 444 ** Function AVRC_PassRsp 445 ** 446 ** Description Send a PASS THROUGH response to the peer device. This 447 ** function can only be called for target role connections. 448 ** This function must be called when a PASS THROUGH command 449 ** message is received from the peer through the 450 ** tAVRC_MSG_CBACK callback function. 451 ** 452 ** Input Parameters: 453 ** handle: Handle of this connection. 454 ** 455 ** label: Transaction label. Must be the same value as 456 ** passed with the command message in the callback function. 457 ** 458 ** p_msg: Pointer to PASS THROUGH message structure. 459 ** 460 ** Output Parameters: 461 ** None. 462 ** 463 ** Returns AVRC_SUCCESS if successful. 464 ** AVRC_BAD_HANDLE if handle is invalid. 465 ** 466 ******************************************************************************/ 467 extern UINT16 AVRC_PassRsp(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg); 468 469 470 /****************************************************************************** 471 ** 472 ** Function AVRC_VendorCmd 473 ** 474 ** Description Send a VENDOR DEPENDENT command to the peer device. This 475 ** function can only be called for controller role connections. 476 ** Any response message from the peer is passed back through 477 ** the tAVRC_MSG_CBACK callback function. 478 ** 479 ** Input Parameters: 480 ** handle: Handle of this connection. 481 ** 482 ** label: Transaction label. 483 ** 484 ** p_msg: Pointer to VENDOR DEPENDENT message structure. 485 ** 486 ** Output Parameters: 487 ** None. 488 ** 489 ** Returns AVRC_SUCCESS if successful. 490 ** AVRC_BAD_HANDLE if handle is invalid. 491 ** 492 ******************************************************************************/ 493 extern UINT16 AVRC_VendorCmd(UINT8 handle, UINT8 label, tAVRC_MSG_VENDOR *p_msg); 494 495 496 /****************************************************************************** 497 ** 498 ** Function AVRC_VendorRsp 499 ** 500 ** Description Send a VENDOR DEPENDENT response to the peer device. This 501 ** function can only be called for target role connections. 502 ** This function must be called when a VENDOR DEPENDENT 503 ** command message is received from the peer through the 504 ** tAVRC_MSG_CBACK callback function. 505 ** 506 ** Input Parameters: 507 ** handle: Handle of this connection. 508 ** 509 ** label: Transaction label. Must be the same value as 510 ** passed with the command message in the callback function. 511 ** 512 ** p_msg: Pointer to VENDOR DEPENDENT message structure. 513 ** 514 ** Output Parameters: 515 ** None. 516 ** 517 ** Returns AVRC_SUCCESS if successful. 518 ** AVRC_BAD_HANDLE if handle is invalid. 519 ** 520 ******************************************************************************/ 521 extern UINT16 AVRC_VendorRsp(UINT8 handle, UINT8 label, tAVRC_MSG_VENDOR *p_msg); 522 523 524 /****************************************************************************** 525 ** 526 ** Function AVRC_SetTraceLevel 527 ** 528 ** Description Sets the trace level for AVRC. If 0xff is passed, the 529 ** current trace level is returned. 530 ** 531 ** Input Parameters: 532 ** new_level: The level to set the AVRC tracing to: 533 ** 0xff-returns the current setting. 534 ** 0-turns off tracing. 535 ** >= 1-Errors. 536 ** >= 2-Warnings. 537 ** >= 3-APIs. 538 ** >= 4-Events. 539 ** >= 5-Debug. 540 ** 541 ** Returns The new trace level or current trace level if 542 ** the input parameter is 0xff. 543 ** 544 ******************************************************************************/ 545 extern UINT8 AVRC_SetTraceLevel (UINT8 new_level); 546 547 /******************************************************************************* 548 ** 549 ** Function AVRC_Init 550 ** 551 ** Description This function is called at stack startup to allocate the 552 ** control block (if using dynamic memory), and initializes the 553 ** control block and tracing level. 554 ** 555 ** Returns status 556 ** 557 *******************************************************************************/ 558 extern bt_status_t AVRC_Init(void); 559 560 /******************************************************************************* 561 ** 562 ** Function AVRC_Deinit 563 ** 564 ** Description This function is called at stack shotdown to free the 565 ** control block (if using dynamic memory), and deinitializes the 566 ** control block and tracing level. 567 ** 568 ** Returns void 569 ** 570 *******************************************************************************/ 571 extern void AVRC_Deinit(void); 572 573 /******************************************************************************* 574 ** 575 ** Function AVRC_ParsCommand 576 ** 577 ** Description This function is used to parse the received command. 578 ** 579 ** Returns AVRC_STS_NO_ERROR, if the message in p_data is parsed successfully. 580 ** Otherwise, the error code defined by AVRCP 1.4 581 ** 582 *******************************************************************************/ 583 extern tAVRC_STS AVRC_ParsCommand (tAVRC_MSG *p_msg, tAVRC_COMMAND *p_result, 584 UINT8 *p_buf, UINT16 buf_len); 585 586 /******************************************************************************* 587 ** 588 ** Function AVRC_ParsResponse 589 ** 590 ** Description This function is used to parse the received response. 591 ** 592 ** Returns AVRC_STS_NO_ERROR, if the message in p_data is parsed successfully. 593 ** Otherwise, the error code defined by AVRCP 1.4 594 ** 595 *******************************************************************************/ 596 extern tAVRC_STS AVRC_ParsResponse (tAVRC_MSG *p_msg, tAVRC_RESPONSE *p_result); 597 598 /******************************************************************************* 599 ** 600 ** Function AVRC_BldCommand 601 ** 602 ** Description This function builds the given AVRCP command to the given 603 ** GKI buffer 604 ** 605 ** Returns AVRC_STS_NO_ERROR, if the command is built successfully 606 ** Otherwise, the error code. 607 ** 608 *******************************************************************************/ 609 extern tAVRC_STS AVRC_BldCommand( tAVRC_COMMAND *p_cmd, BT_HDR **pp_pkt); 610 611 /******************************************************************************* 612 ** 613 ** Function AVRC_BldResponse 614 ** 615 ** Description This function builds the given AVRCP response to the given 616 ** GKI buffer 617 ** 618 ** Returns AVRC_STS_NO_ERROR, if the response is built successfully 619 ** Otherwise, the error code. 620 ** 621 *******************************************************************************/ 622 extern tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt); 623 624 /************************************************************************** 625 ** 626 ** Function AVRC_IsValidAvcType 627 ** 628 ** Description Check if correct AVC type is specified 629 ** 630 ** Returns returns TRUE if it is valid 631 ** 632 ** 633 *******************************************************************************/ 634 extern BOOLEAN AVRC_IsValidAvcType(UINT8 pdu_id, UINT8 avc_type); 635 636 /******************************************************************************* 637 ** 638 ** Function AVRC_IsValidPlayerAttr 639 ** 640 ** Description Check if the given attrib value is a valid one 641 ** 642 ** 643 ** Returns returns TRUE if it is valid 644 ** 645 *******************************************************************************/ 646 extern BOOLEAN AVRC_IsValidPlayerAttr(UINT8 attr); 647 648 #ifdef __cplusplus 649 } 650 #endif 651 652 #endif ///AVRC_INCLUDED == TRUE 653 654 655 #endif /* AVRC_API_H */ 656