mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-03 01:20:35 +00:00
avrcp_controller: use get_capabilities_for_connection
This commit is contained in:
parent
826b3cedbf
commit
1f94eaa583
@ -1377,7 +1377,7 @@ uint8_t avrcp_controller_subunit_info(uint16_t avrcp_cid){
|
|||||||
return ERROR_CODE_SUCCESS;
|
return ERROR_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t avrcp_controller_get_capabilities(uint16_t avrcp_cid, uint8_t capability_id){
|
uint8_t avrcp_controller_get_supported_company_ids(uint16_t avrcp_cid){
|
||||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
||||||
if (!connection){
|
if (!connection){
|
||||||
log_error("avrcp_get_capabilities: could not find a connection.");
|
log_error("avrcp_get_capabilities: could not find a connection.");
|
||||||
@ -1386,15 +1386,22 @@ static uint8_t avrcp_controller_get_capabilities(uint16_t avrcp_cid, uint8_t cap
|
|||||||
if (connection->state != AVCTP_CONNECTION_OPENED){
|
if (connection->state != AVCTP_CONNECTION_OPENED){
|
||||||
return ERROR_CODE_COMMAND_DISALLOWED;
|
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||||
}
|
}
|
||||||
return avrcp_controller_get_capabilities_for_connection(connection, capability_id);
|
avrcp_controller_get_capabilities_for_connection(connection, AVRCP_CAPABILITY_ID_COMPANY);
|
||||||
}
|
return ERROR_CODE_SUCCESS;
|
||||||
|
|
||||||
uint8_t avrcp_controller_get_supported_company_ids(uint16_t avrcp_cid){
|
|
||||||
return avrcp_controller_get_capabilities(avrcp_cid, AVRCP_CAPABILITY_ID_COMPANY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t avrcp_controller_get_supported_events(uint16_t avrcp_cid){
|
uint8_t avrcp_controller_get_supported_events(uint16_t avrcp_cid){
|
||||||
return avrcp_controller_get_capabilities(avrcp_cid, AVRCP_CAPABILITY_ID_EVENT);
|
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
||||||
|
if (!connection){
|
||||||
|
log_error("avrcp_get_capabilities: could not find a connection.");
|
||||||
|
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||||
|
}
|
||||||
|
if (connection->state != AVCTP_CONNECTION_OPENED){
|
||||||
|
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||||
|
}
|
||||||
|
|
||||||
|
avrcp_controller_get_capabilities_for_connection(connection, AVRCP_CAPABILITY_ID_EVENT);
|
||||||
|
return ERROR_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t avrcp_controller_get_play_status(uint16_t avrcp_cid){
|
uint8_t avrcp_controller_get_play_status(uint16_t avrcp_cid){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user