15738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 25738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 35738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * Copyright (C) 2006-2012 Broadcom Corporation 45738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 55738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License"); 65738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * you may not use this file except in compliance with the License. 75738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * You may obtain a copy of the License at: 85738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 95738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * Unless required by applicable law or agreed to in writing, software 125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS, 135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * See the License for the specific language governing permissions and 155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * limitations under the License. 165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project ******************************************************************************/ 185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * nterface to AVRCP Application Programming Interface 225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * 235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project ******************************************************************************/ 245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifndef AVRC_API_H 255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_API_H 265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "bt_target.h" 275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "avct_api.h" 285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "sdp_api.h" 295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#include "avrc_defs.h" 305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/***************************************************************************** 325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** constants 335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*****************************************************************************/ 345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* API function return value result codes. */ 365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUCCESS AVCT_SUCCESS /* 0 Function successful */ 375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_NO_RESOURCES AVCT_NO_RESOURCES /* 1 Not enough resources */ 385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_BAD_HANDLE AVCT_BAD_HANDLE /* 2 Bad handle */ 395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_PID_IN_USE AVCT_PID_IN_USE /* 3 PID already in use */ 405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_NOT_OPEN AVCT_NOT_OPEN /* 4 Connection not open */ 415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_MSG_TOO_BIG 5 /* 5 the message length exceed the MTU of the browsing channel */ 425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_FAIL 0x10 /* 0x10 generic failure */ 435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_BAD_PARAM 0x11 /* 0x11 bad parameter */ 445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Control role - same as AVCT_TARGET/AVCT_CONTROL */ 465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_CT_TARGET 1 /* target */ 475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_CT_CONTROL 2 /* controller */ 485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_CT_PASSIVE 4 /* If conflict, allow the other side to succeed */ 495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Connection role */ 515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_CONN_INT AVCT_INT /* initiator */ 525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_CONN_ACP AVCT_ACP /* Acceptor */ 535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* AVRC CTRL events */ 565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* AVRC_OPEN_IND_EVT event is sent when the connection is successfully opened. 575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * This eventis sent in response to an AVRC_Open(). */ 585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_OPEN_IND_EVT 0 595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* AVRC_CLOSE_IND_EVT event is sent when a connection is closed. 615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * This event can result from a call to AVRC_Close() or when the peer closes 625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * the connection. It is also sent when a connection attempted through 635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * AVRC_Open() fails. */ 645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_CLOSE_IND_EVT 1 655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* AVRC_CONG_IND_EVT event indicates that AVCTP is congested and cannot send 675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * any more messages. */ 685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_CONG_IND_EVT 2 695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* AVRC_UNCONG_IND_EVT event indicates that AVCTP is uncongested and ready to 715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * send messages. */ 725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_UNCONG_IND_EVT 3 735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project /* AVRC_BROWSE_OPEN_IND_EVT event is sent when the browse channel is successfully opened. 755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * This eventis sent in response to an AVRC_Open() or AVRC_OpenBrowse() . */ 765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_BROWSE_OPEN_IND_EVT 4 775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* AVRC_BROWSE_CLOSE_IND_EVT event is sent when a browse channel is closed. 795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * This event can result from a call to AVRC_Close(), AVRC_CloseBrowse() or when the peer closes 805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * the connection. It is also sent when a connection attempted through 815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * AVRC_OpenBrowse() fails. */ 825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_BROWSE_CLOSE_IND_EVT 5 835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* AVRC_BROWSE_CONG_IND_EVT event indicates that AVCTP browse channel is congested and cannot send 855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * any more messages. */ 865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_BROWSE_CONG_IND_EVT 6 875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* AVRC_BROWSE_UNCONG_IND_EVT event indicates that AVCTP browse channel is uncongested and ready to 895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * send messages. */ 905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_BROWSE_UNCONG_IND_EVT 7 915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 929609cee33087141eeb7b5adede488d7e13bfcebdSharvil Nanavati/* AVRC_CMD_TIMEOUT_EVT event indicates timeout waiting for AVRC command response from the peer */ 939609cee33087141eeb7b5adede488d7e13bfcebdSharvil Nanavati#define AVRC_CMD_TIMEOUT_EVT 8 949609cee33087141eeb7b5adede488d7e13bfcebdSharvil Nanavati 955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* Supported categories */ 965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_CT_CAT1 0x0001 /* Category 1 */ 975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_CT_CAT2 0x0002 /* Category 2 */ 985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_CT_CAT3 0x0004 /* Category 3 */ 995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_CT_CAT4 0x0008 /* Category 4 */ 1005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_CT_BROWSE 0x0040 /* Browsing */ 1015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_TG_CAT1 0x0001 /* Category 1 */ 1035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_TG_CAT2 0x0002 /* Category 2 */ 1045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_TG_CAT3 0x0004 /* Category 3 */ 1055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_TG_CAT4 0x0008 /* Category 4 */ 1065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_TG_APP_SETTINGS 0x0010 /* Player Application Settings */ 1075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_TG_GROUP_NAVI 0x0020 /* Group Navigation */ 1085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_TG_BROWSE 0x0040 /* Browsing */ 1095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_SUPF_TG_MULTI_PLAYER 0x0080 /* Muliple Media Player */ 1105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_META_SUCCESS AVRC_SUCCESS 1125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_META_FAIL AVRC_FAIL 1135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_METADATA_CMD 0x0000 1145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#define AVRC_METADATA_RESP 0x0001 1155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/***************************************************************************** 1195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** data type definitions 1205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*****************************************************************************/ 1215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* This data type is used in AVRC_FindService() to initialize the SDP database 1235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * to hold the result service search. */ 1245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projecttypedef struct 1255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project{ 1265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT32 db_len; /* Length, in bytes, of the discovery database */ 1275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tSDP_DISCOVERY_DB *p_db; /* Pointer to the discovery database */ 1285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT16 num_attr;/* The number of attributes in p_attrs */ 1295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT16 *p_attrs; /* The attributes filter. If NULL, AVRCP API sets the attribute filter 1305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * to be ATTR_ID_SERVICE_CLASS_ID_LIST, ATTR_ID_BT_PROFILE_DESC_LIST, 1315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * ATTR_ID_SUPPORTED_FEATURES, ATTR_ID_SERVICE_NAME and ATTR_ID_PROVIDER_NAME. 1325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * If not NULL, the input is taken as the filter. */ 1335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tAVRC_SDP_DB_PARAMS; 1345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* This callback function returns service discovery information to the 1365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * application after the AVRC_FindService() API function is called. The 1375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * implementation of this callback function must copy the p_service_name 1385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * and p_provider_name parameters passed to it as they are not guaranteed 1395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * to remain after the callback function exits. */ 1405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projecttypedef void (tAVRC_FIND_CBACK) (UINT16 status); 1415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* This is the control callback function. This function passes events 1445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * listed in Table 20 to the application. */ 1455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projecttypedef void (tAVRC_CTRL_CBACK) (UINT8 handle, UINT8 event, UINT16 result, 1465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project BD_ADDR peer_addr); 1475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/* This is the message callback function. It is executed when AVCTP has 1505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * a message packet ready for the application. The implementation of this 1515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * callback function must copy the tAVRC_MSG structure passed to it as it 1525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project * is not guaranteed to remain after the callback function exits. */ 1535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projecttypedef void (tAVRC_MSG_CBACK) (UINT8 handle, UINT8 label, UINT8 opcode, 1545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tAVRC_MSG *p_msg); 1555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projecttypedef struct 1575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project{ 1585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tAVRC_CTRL_CBACK *p_ctrl_cback; /* pointer to application control callback */ 1595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project tAVRC_MSG_CBACK *p_msg_cback; /* pointer to application message callback */ 1605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT32 company_id; /* the company ID */ 1615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT8 conn; /* Connection role (Initiator/acceptor) */ 1625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project UINT8 control; /* Control role (Control/Target) */ 1635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} tAVRC_CONN_CB; 1645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/***************************************************************************** 1685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** external function declarations 1695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*****************************************************************************/ 1705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifdef __cplusplus 1715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Projectextern "C" 1725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project{ 1735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif 1745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 1755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 1765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 1775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_AddRecord 1785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 1795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function is called to build an AVRCP SDP record. 1805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Prior to calling this function the application must 1815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** call SDP_CreateRecord() to create an SDP record. 1825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 1835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 1845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** service_uuid: Indicates TG(UUID_SERVCLASS_AV_REM_CTRL_TARGET) 1855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** or CT(UUID_SERVCLASS_AV_REMOTE_CONTROL) 1865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 1875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_service_name: Pointer to a null-terminated character 1885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** string containing the service name. 1895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** If service name is not used set this to NULL. 1905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 1915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_provider_name: Pointer to a null-terminated character 1925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** string containing the provider name. 1935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** If provider name is not used set this to NULL. 1945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 1955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** categories: Supported categories. 1965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 1975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** sdp_handle: SDP handle returned by SDP_CreateRecord(). 1985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 1995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 2005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 2015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 2035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_NO_RESOURCES if not enough resources to build the SDP record. 2045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 20624933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_AddRecord(UINT16 service_uuid, char *p_service_name, 2075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project char *p_provider_name, UINT16 categories, UINT32 sdp_handle); 2085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 2095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 2105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_FindService 2125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function is called by the application to perform service 2145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** discovery and retrieve AVRCP SDP record information from a 2155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** peer device. Information is returned for the first service 2165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** record found on the server that matches the service UUID. 2175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** The callback function will be executed when service discovery 2185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** is complete. There can only be one outstanding call to 2195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_FindService() at a time; the application must wait for 2205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the callback before it makes another call to the function. 2215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** The application is responsible for allocating memory for the 2225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** discovery database. It is recommended that the size of the 2235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** discovery database be at least 300 bytes. The application 2245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** can deallocate the memory after the callback function has 2255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** executed. 2265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 2285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** service_uuid: Indicates TG(UUID_SERVCLASS_AV_REM_CTRL_TARGET) 2295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** or CT(UUID_SERVCLASS_AV_REMOTE_CONTROL) 2305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** bd_addr: BD address of the peer device. 2325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_db: SDP discovery database parameters. 2345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_cback: Pointer to the callback function. 2365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 2385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 2395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 2415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_PARAMS if discovery database parameters are invalid. 2425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_NO_RESOURCES if there are not enough resources to 2435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** perform the service search. 2445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 24624933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_FindService(UINT16 service_uuid, BD_ADDR bd_addr, 24724933b5b1a06274c47133debac5251a97128a267June R. Tate-Gans tAVRC_SDP_DB_PARAMS *p_db, tAVRC_FIND_CBACK *p_cback); 2485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 2495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 2505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_Open 2525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function is called to open a connection to AVCTP. 2545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** The connection can be either an initiator or acceptor, as 2555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** determined by the p_ccb->stream parameter. 2565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** The connection can be a target, a controller or for both role, 2575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** as determined by the p_ccb->control parameter. 2585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** By definition, a target connection is an acceptor connection 2595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** that waits for an incoming AVCTP connection from the peer. 2605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** The connection remains available to the application until 2615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the application closes it by calling AVRC_Close(). The 2625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** application does not need to reopen the connection after an 2635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_CLOSE_IND_EVT is received. 2645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 2665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_ccb->company_id: Company Identifier. 2675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_ccb->p_ctrl_cback: Pointer to control callback function. 2695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_ccb->p_msg_cback: Pointer to message callback function. 2715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_ccb->conn: AVCTP connection role. This is set to 2735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVCTP_INT for initiator connections and AVCTP_ACP 2745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** for acceptor connections. 2755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_ccb->control: Control role. This is set to 2775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_CT_TARGET for target connections, AVRC_CT_CONTROL 2785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** for control connections or (AVRC_CT_TARGET|AVRC_CT_CONTROL) 2795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** for connections that support both roles. 2805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** peer_addr: BD address of peer device. This value is 2825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** only used for initiator connections; for acceptor 2835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** connections it can be set to NULL. 2845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 2865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_handle: Pointer to handle. This parameter is only 2875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** valid if AVRC_SUCCESS is returned. 2885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 2905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_NO_RESOURCES if there are not enough resources to open 2915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the connection. 2925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 29424933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_Open(UINT8 *p_handle, tAVRC_CONN_CB *p_ccb, 29524933b5b1a06274c47133debac5251a97128a267June R. Tate-Gans BD_ADDR_PTR peer_addr); 2965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 2975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 2985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 2995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_Close 3005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Close a connection opened with AVRC_Open(). 3025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** This function is called when the 3035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** application is no longer using a connection. 3045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 3065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** handle: Handle of this connection. 3075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 3095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 3105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 3125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 3135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 31524933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_Close(UINT8 handle); 3165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 3175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 3185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_OpenBrowse 3205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function is called to open a browsing connection to AVCTP. 3225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** The connection can be either an initiator or acceptor, as 3235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** determined by the conn_role. 3245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** The handle is returned by a previous call to AVRC_Open. 3255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 3275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_NO_RESOURCES if there are not enough resources to open 3285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the connection. 3295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 33124933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_OpenBrowse(UINT8 handle, UINT8 conn_role); 3325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 3335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 3345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_CloseBrowse 3365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Close a connection opened with AVRC_OpenBrowse(). 3385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** This function is called when the 3395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** application is no longer using a connection. 3405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 3425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 3435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 34524933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_CloseBrowse(UINT8 handle); 3465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 3475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 3485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_MsgReq 3505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function is used to send the AVRCP byte stream in p_pkt 3525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** down to AVCTP. 3535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** It is expected that p_pkt->offset is at least AVCT_MSG_OFFSET 3555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_pkt->layer_specific is AVCT_DATA_CTRL or AVCT_DATA_BROWSE 3565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_pkt->event is AVRC_OP_VENDOR, AVRC_OP_PASS_THRU or AVRC_OP_BROWSING 3575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** The above BT_HDR settings are set by the AVRC_Bld* functions. 3585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 3605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 3615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 36324933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_MsgReq (UINT8 handle, UINT8 label, UINT8 ctype, BT_HDR *p_pkt); 3645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 3655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 3665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_UnitCmd 3685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Send a UNIT INFO command to the peer device. This 3705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** function can only be called for controller role connections. 3715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Any response message from the peer is passed back through 3725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the tAVRC_MSG_CBACK callback function. 3735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 3755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** handle: Handle of this connection. 3765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** label: Transaction label. 3785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 3805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 3815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 3835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 3845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 38624933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_UnitCmd(UINT8 handle, UINT8 label); 3875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 3885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 3895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_SubCmd 3915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Send a SUBUNIT INFO command to the peer device. This 3935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** function can only be called for controller role connections. 3945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Any response message from the peer is passed back through 3955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the tAVRC_MSG_CBACK callback function. 3965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 3975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 3985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** handle: Handle of this connection. 3995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** label: Transaction label. 4015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** page: Specifies which part of the subunit type table 4035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** is requested. For AVRCP it is typically zero. 4045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Value range is 0-7. 4055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 4075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 4085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 4105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 4115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 41324933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_SubCmd(UINT8 handle, UINT8 label, UINT8 page); 4145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 4155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 4165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 4175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_PassCmd 4195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Send a PASS THROUGH command to the peer device. This 4215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** function can only be called for controller role connections. 4225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Any response message from the peer is passed back through 4235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the tAVRC_MSG_CBACK callback function. 4245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 4265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** handle: Handle of this connection. 4275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** label: Transaction label. 4295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_msg: Pointer to PASS THROUGH message structure. 4315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 4335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 4345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 4365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 4375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 43924933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_PassCmd(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg); 4405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 4415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 4425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_PassRsp 4445738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Send a PASS THROUGH response to the peer device. This 4465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** function can only be called for target role connections. 4475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** This function must be called when a PASS THROUGH command 4485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** message is received from the peer through the 4495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** tAVRC_MSG_CBACK callback function. 4505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 4525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** handle: Handle of this connection. 4535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** label: Transaction label. Must be the same value as 4555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** passed with the command message in the callback function. 4565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4575738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_msg: Pointer to PASS THROUGH message structure. 4585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 4605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 4615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 4635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 4645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 46624933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_PassRsp(UINT8 handle, UINT8 label, tAVRC_MSG_PASS *p_msg); 4675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 4685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 4695738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 4705738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_VendorCmd 4725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Send a VENDOR DEPENDENT command to the peer device. This 4745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** function can only be called for controller role connections. 4755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Any response message from the peer is passed back through 4765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the tAVRC_MSG_CBACK callback function. 4775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 4795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** handle: Handle of this connection. 4805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** label: Transaction label. 4825738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4835738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_msg: Pointer to VENDOR DEPENDENT message structure. 4845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 4865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 4875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 4895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 4905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 49224933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_VendorCmd(UINT8 handle, UINT8 label, tAVRC_MSG_VENDOR *p_msg); 4935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 4945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 4955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 4965738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_VendorRsp 4985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 4995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Send a VENDOR DEPENDENT response to the peer device. This 5005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** function can only be called for target role connections. 5015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** This function must be called when a VENDOR DEPENDENT 5025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** command message is received from the peer through the 5035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** tAVRC_MSG_CBACK callback function. 5045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 5065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** handle: Handle of this connection. 5075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** label: Transaction label. Must be the same value as 5095738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** passed with the command message in the callback function. 5105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** p_msg: Pointer to VENDOR DEPENDENT message structure. 5125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Output Parameters: 5145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** None. 5155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_SUCCESS if successful. 5175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** AVRC_BAD_HANDLE if handle is invalid. 5185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 52024933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT16 AVRC_VendorRsp(UINT8 handle, UINT8 label, tAVRC_MSG_VENDOR *p_msg); 5215738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 5225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 5235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/****************************************************************************** 5245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_SetTraceLevel 5265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Sets the trace level for AVRC. If 0xff is passed, the 5285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** current trace level is returned. 5295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Input Parameters: 5315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** new_level: The level to set the AVRC tracing to: 5325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 0xff-returns the current setting. 5335738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 0-turns off tracing. 5345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** >= 1-Errors. 5355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** >= 2-Warnings. 5365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** >= 3-APIs. 5375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** >= 4-Events. 5385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** >= 5-Debug. 5395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5405738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns The new trace level or current trace level if 5415738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** the input parameter is 0xff. 5425738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5435738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project******************************************************************************/ 54424933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern UINT8 AVRC_SetTraceLevel (UINT8 new_level); 5455738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 5465738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************* 5475738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5485738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_Init 5495738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5505738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function is called at stack startup to allocate the 5515738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** control block (if using dynamic memory), and initializes the 5525738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** control block and tracing level. 5535738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5545738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns void 5555738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5565738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/ 55724933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern void AVRC_Init(void); 5585738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 5595738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************* 5605738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5615738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_ParsCommand 5625738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5635738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function is used to parse the received command. 5645738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5655738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_STS_NO_ERROR, if the message in p_data is parsed successfully. 5665738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Otherwise, the error code defined by AVRCP 1.4 5675738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5685738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/ 56924933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern tAVRC_STS AVRC_ParsCommand (tAVRC_MSG *p_msg, tAVRC_COMMAND *p_result, 57024933b5b1a06274c47133debac5251a97128a267June R. Tate-Gans UINT8 *p_buf, UINT16 buf_len); 5715738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 5725738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************* 5735738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5745738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_ParsResponse 5755738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5765738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function is used to parse the received response. 5775738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5785738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_STS_NO_ERROR, if the message in p_data is parsed successfully. 5795738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Otherwise, the error code defined by AVRCP 1.4 5805738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5815738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/ 58224933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern tAVRC_STS AVRC_ParsResponse (tAVRC_MSG *p_msg, tAVRC_RESPONSE *p_result, 58324933b5b1a06274c47133debac5251a97128a267June R. Tate-Gans UINT8 *p_buf, UINT16 buf_len); 5845738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 5855738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************* 5865738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5875738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_BldCommand 5885738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5895738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function builds the given AVRCP command to the given 5905738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** GKI buffer 5915738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5925738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_STS_NO_ERROR, if the command is built successfully 5935738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Otherwise, the error code. 5945738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 5955738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/ 59624933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern tAVRC_STS AVRC_BldCommand( tAVRC_COMMAND *p_cmd, BT_HDR **pp_pkt); 5975738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 5985738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************* 5995738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6005738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_BldResponse 6015738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6025738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description This function builds the given AVRCP response to the given 6035738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** GKI buffer 6045738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6055738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns AVRC_STS_NO_ERROR, if the response is built successfully 6065738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Otherwise, the error code. 6075738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6085738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/ 60924933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern tAVRC_STS AVRC_BldResponse( UINT8 handle, tAVRC_RESPONSE *p_rsp, BT_HDR **pp_pkt); 6105738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 6115738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/************************************************************************** 6125738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6135738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_IsValidAvcType 6145738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6155738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Check if correct AVC type is specified 6165738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6175738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns returns TRUE if it is valid 6185738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6195738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6205738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/ 62124933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern BOOLEAN AVRC_IsValidAvcType(UINT8 pdu_id, UINT8 avc_type); 6225738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 6235738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project/******************************************************************************* 6245738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6255738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Function AVRC_IsValidPlayerAttr 6265738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6275738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Description Check if the given attrib value is a valid one 6285738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6295738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6305738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** Returns returns TRUE if it is valid 6315738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project** 6325738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project*******************************************************************************/ 63324933b5b1a06274c47133debac5251a97128a267June R. Tate-Gansextern BOOLEAN AVRC_IsValidPlayerAttr(UINT8 attr); 6345738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 6355738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#ifdef __cplusplus 6365738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project} 6375738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif 6385738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project 6395738f83aeb59361a0a2eda2460113f6dc919427The Android Open Source Project#endif /* AVRC_API_H */ 640