mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 22:20:37 +00:00
avrcp: rename getter functions
This commit is contained in:
parent
84521ac169
commit
1945fe3ea5
@ -297,7 +297,7 @@ void avrcp_create_sdp_record(uint8_t controller, uint8_t * service, uint32_t ser
|
||||
de_add_number(service, DE_UINT, DE_SIZE_16, supported_features);
|
||||
}
|
||||
|
||||
avrcp_connection_t * get_avrcp_connection_for_bd_addr_for_role(avrcp_role_t role, bd_addr_t addr){
|
||||
avrcp_connection_t * avrcp_get_connection_for_bd_addr_for_role(avrcp_role_t role, bd_addr_t addr){
|
||||
btstack_linked_list_iterator_t it;
|
||||
btstack_linked_list_iterator_init(&it, (btstack_linked_list_t *) &connections);
|
||||
while (btstack_linked_list_iterator_has_next(&it)){
|
||||
@ -309,7 +309,7 @@ avrcp_connection_t * get_avrcp_connection_for_bd_addr_for_role(avrcp_role_t role
|
||||
return NULL;
|
||||
}
|
||||
|
||||
avrcp_connection_t * get_avrcp_connection_for_l2cap_signaling_cid_for_role(avrcp_role_t role, uint16_t l2cap_cid){
|
||||
avrcp_connection_t * avrcp_get_connection_for_l2cap_signaling_cid_for_role(avrcp_role_t role, uint16_t l2cap_cid){
|
||||
btstack_linked_list_iterator_t it;
|
||||
btstack_linked_list_iterator_init(&it, (btstack_linked_list_t *) &connections);
|
||||
while (btstack_linked_list_iterator_has_next(&it)){
|
||||
@ -321,7 +321,7 @@ avrcp_connection_t * get_avrcp_connection_for_l2cap_signaling_cid_for_role(avrcp
|
||||
return NULL;
|
||||
}
|
||||
|
||||
avrcp_connection_t * get_avrcp_connection_for_avrcp_cid_for_role(avrcp_role_t role, uint16_t avrcp_cid){
|
||||
avrcp_connection_t * avrcp_get_connection_for_avrcp_cid_for_role(avrcp_role_t role, uint16_t avrcp_cid){
|
||||
btstack_linked_list_iterator_t it;
|
||||
btstack_linked_list_iterator_init(&it, (btstack_linked_list_t *) &connections);
|
||||
while (btstack_linked_list_iterator_has_next(&it)){
|
||||
@ -333,7 +333,7 @@ avrcp_connection_t * get_avrcp_connection_for_avrcp_cid_for_role(avrcp_role_t ro
|
||||
return NULL;
|
||||
}
|
||||
|
||||
avrcp_connection_t * get_avrcp_connection_for_browsing_cid_for_role(avrcp_role_t role, uint16_t browsing_cid){
|
||||
avrcp_connection_t * avrcp_get_connection_for_browsing_cid_for_role(avrcp_role_t role, uint16_t browsing_cid){
|
||||
btstack_linked_list_iterator_t it;
|
||||
btstack_linked_list_iterator_init(&it, (btstack_linked_list_t *) &connections);
|
||||
while (btstack_linked_list_iterator_has_next(&it)){
|
||||
@ -345,7 +345,7 @@ avrcp_connection_t * get_avrcp_connection_for_browsing_cid_for_role(avrcp_role_t
|
||||
return NULL;
|
||||
}
|
||||
|
||||
avrcp_connection_t * get_avrcp_connection_for_browsing_l2cap_cid_for_role(avrcp_role_t role, uint16_t browsing_l2cap_cid){
|
||||
avrcp_connection_t * avrcp_get_connection_for_browsing_l2cap_cid_for_role(avrcp_role_t role, uint16_t browsing_l2cap_cid){
|
||||
btstack_linked_list_iterator_t it;
|
||||
btstack_linked_list_iterator_init(&it, (btstack_linked_list_t *) &connections);
|
||||
while (btstack_linked_list_iterator_has_next(&it)){
|
||||
@ -357,7 +357,7 @@ avrcp_connection_t * get_avrcp_connection_for_browsing_l2cap_cid_for_role(avrcp_
|
||||
return NULL;
|
||||
}
|
||||
|
||||
avrcp_browsing_connection_t * get_avrcp_browsing_connection_for_l2cap_cid_for_role(avrcp_role_t role, uint16_t l2cap_cid){
|
||||
avrcp_browsing_connection_t * avrcp_get_browsing_connection_for_l2cap_cid_for_role(avrcp_role_t role, uint16_t l2cap_cid){
|
||||
btstack_linked_list_iterator_t it;
|
||||
btstack_linked_list_iterator_init(&it, (btstack_linked_list_t *) &connections);
|
||||
while (btstack_linked_list_iterator_has_next(&it)){
|
||||
@ -381,7 +381,7 @@ uint16_t avrcp_get_next_cid(avrcp_role_t role){
|
||||
} else {
|
||||
avrcp_cid_counter++;
|
||||
}
|
||||
} while (get_avrcp_connection_for_avrcp_cid_for_role(role, avrcp_cid_counter) != NULL) ;
|
||||
} while (avrcp_get_connection_for_avrcp_cid_for_role(role, avrcp_cid_counter) != NULL) ;
|
||||
return avrcp_cid_counter;
|
||||
}
|
||||
|
||||
@ -579,8 +579,8 @@ static void avrcp_handle_sdp_client_query_result(uint8_t packet_type, uint16_t c
|
||||
UNUSED(channel);
|
||||
UNUSED(size);
|
||||
|
||||
avrcp_connection_t * avrcp_target_connection = get_avrcp_connection_for_bd_addr_for_role(AVRCP_TARGET, sdp_query_context->remote_addr);
|
||||
avrcp_connection_t * avrcp_controller_connection = get_avrcp_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, sdp_query_context->remote_addr);
|
||||
avrcp_connection_t * avrcp_target_connection = avrcp_get_connection_for_bd_addr_for_role(AVRCP_TARGET, sdp_query_context->remote_addr);
|
||||
avrcp_connection_t * avrcp_controller_connection = avrcp_get_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, sdp_query_context->remote_addr);
|
||||
|
||||
uint8_t status;
|
||||
|
||||
@ -644,9 +644,9 @@ static void avrcp_handle_open_connection_for_role( avrcp_connection_t * connecti
|
||||
|
||||
static void avrcp_reconnect_timer_timeout_handler(btstack_timer_source_t * timer){
|
||||
uint16_t avrcp_cid = (uint16_t)(uintptr_t) btstack_run_loop_get_timer_context(timer);
|
||||
avrcp_connection_t * connection_controller = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
||||
avrcp_connection_t * connection_controller = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
||||
if (connection_controller == NULL) return;
|
||||
avrcp_connection_t * connection_target = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection_target = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (connection_target == NULL) return;
|
||||
|
||||
if (connection_controller->state == AVCTP_CONNECTION_W2_L2CAP_RECONNECT){
|
||||
@ -696,7 +696,7 @@ static void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
|
||||
local_cid = l2cap_event_incoming_connection_get_local_cid(packet);
|
||||
outoing_active = false;
|
||||
|
||||
connection_target = get_avrcp_connection_for_bd_addr_for_role(AVRCP_TARGET, event_addr);
|
||||
connection_target = avrcp_get_connection_for_bd_addr_for_role(AVRCP_TARGET, event_addr);
|
||||
if (connection_target != NULL){
|
||||
if (connection_target->state == AVCTP_CONNECTION_W4_L2CAP_CONNECTED){
|
||||
outoing_active = true;
|
||||
@ -704,7 +704,7 @@ static void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
|
||||
}
|
||||
}
|
||||
|
||||
connection_controller = get_avrcp_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, event_addr);
|
||||
connection_controller = avrcp_get_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, event_addr);
|
||||
if (connection_controller != NULL){
|
||||
if (connection_controller->state == AVCTP_CONNECTION_W4_L2CAP_CONNECTED) {
|
||||
outoing_active = true;
|
||||
@ -747,8 +747,8 @@ static void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
|
||||
local_cid = l2cap_event_channel_opened_get_local_cid(packet);
|
||||
l2cap_mtu = l2cap_event_channel_opened_get_remote_mtu(packet);
|
||||
|
||||
connection_controller = get_avrcp_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, event_addr);
|
||||
connection_target = get_avrcp_connection_for_bd_addr_for_role(AVRCP_TARGET, event_addr);
|
||||
connection_controller = avrcp_get_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, event_addr);
|
||||
connection_target = avrcp_get_connection_for_bd_addr_for_role(AVRCP_TARGET, event_addr);
|
||||
|
||||
// incoming: structs are already created in L2CAP_EVENT_INCOMING_CONNECTION
|
||||
// outgoing: structs are cteated in avrcp_connect()
|
||||
@ -786,8 +786,8 @@ static void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
|
||||
case L2CAP_EVENT_CHANNEL_CLOSED:
|
||||
local_cid = l2cap_event_channel_closed_get_local_cid(packet);
|
||||
|
||||
connection_controller = get_avrcp_connection_for_l2cap_signaling_cid_for_role(AVRCP_CONTROLLER, local_cid);
|
||||
connection_target = get_avrcp_connection_for_l2cap_signaling_cid_for_role(AVRCP_TARGET, local_cid);
|
||||
connection_controller = avrcp_get_connection_for_l2cap_signaling_cid_for_role(AVRCP_CONTROLLER, local_cid);
|
||||
connection_target = avrcp_get_connection_for_l2cap_signaling_cid_for_role(AVRCP_TARGET, local_cid);
|
||||
if ((connection_controller == NULL) || (connection_target == NULL)) {
|
||||
break;
|
||||
}
|
||||
@ -799,14 +799,14 @@ static void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
|
||||
case L2CAP_EVENT_CAN_SEND_NOW:
|
||||
local_cid = l2cap_event_can_send_now_get_local_cid(packet);
|
||||
|
||||
connection_target = get_avrcp_connection_for_l2cap_signaling_cid_for_role(AVRCP_TARGET, local_cid);
|
||||
connection_target = avrcp_get_connection_for_l2cap_signaling_cid_for_role(AVRCP_TARGET, local_cid);
|
||||
if ((connection_target != NULL) && connection_target->wait_to_send){
|
||||
connection_target->wait_to_send = false;
|
||||
(*avrcp_target_packet_handler)(HCI_EVENT_PACKET, channel, packet, size);
|
||||
break;
|
||||
}
|
||||
|
||||
connection_controller = get_avrcp_connection_for_l2cap_signaling_cid_for_role(AVRCP_CONTROLLER, local_cid);
|
||||
connection_controller = avrcp_get_connection_for_l2cap_signaling_cid_for_role(AVRCP_CONTROLLER, local_cid);
|
||||
if ((connection_controller != NULL) && connection_controller->wait_to_send){
|
||||
connection_controller->wait_to_send = false;
|
||||
(*avrcp_controller_packet_handler)(HCI_EVENT_PACKET, channel, packet, size);
|
||||
@ -837,11 +837,11 @@ static void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
|
||||
}
|
||||
|
||||
uint8_t avrcp_disconnect(uint16_t avrcp_cid){
|
||||
avrcp_connection_t * connection_controller = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
||||
avrcp_connection_t * connection_controller = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
||||
if (!connection_controller){
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
avrcp_connection_t * connection_target = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection_target = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection_target){
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
@ -871,11 +871,11 @@ uint8_t avrcp_connect(bd_addr_t remote_addr, uint16_t * avrcp_cid){
|
||||
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||
}
|
||||
|
||||
avrcp_connection_t * connection_controller = get_avrcp_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, remote_addr);
|
||||
avrcp_connection_t * connection_controller = avrcp_get_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, remote_addr);
|
||||
if (connection_controller){
|
||||
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||
}
|
||||
avrcp_connection_t * connection_target = get_avrcp_connection_for_bd_addr_for_role(AVRCP_TARGET, remote_addr);
|
||||
avrcp_connection_t * connection_target = avrcp_get_connection_for_bd_addr_for_role(AVRCP_TARGET, remote_addr);
|
||||
if (connection_target){
|
||||
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||
}
|
||||
|
@ -575,13 +575,13 @@ void avrcp_register_target_packet_handler(btstack_packet_handler_t avrcp_target_
|
||||
|
||||
uint8_t avrcp_cmd_opcode(uint8_t *packet, uint16_t size);
|
||||
|
||||
avrcp_connection_t * get_avrcp_connection_for_l2cap_signaling_cid_for_role(avrcp_role_t role, uint16_t l2cap_cid);
|
||||
avrcp_connection_t * get_avrcp_connection_for_avrcp_cid_for_role(avrcp_role_t role, uint16_t avrcp_cid);
|
||||
avrcp_connection_t * get_avrcp_connection_for_bd_addr_for_role(avrcp_role_t role, bd_addr_t addr);
|
||||
avrcp_connection_t * avrcp_get_connection_for_l2cap_signaling_cid_for_role(avrcp_role_t role, uint16_t l2cap_cid);
|
||||
avrcp_connection_t * avrcp_get_connection_for_avrcp_cid_for_role(avrcp_role_t role, uint16_t avrcp_cid);
|
||||
avrcp_connection_t * avrcp_get_connection_for_bd_addr_for_role(avrcp_role_t role, bd_addr_t addr);
|
||||
|
||||
avrcp_connection_t * get_avrcp_connection_for_browsing_cid_for_role(avrcp_role_t role, uint16_t browsing_cid);
|
||||
avrcp_connection_t * get_avrcp_connection_for_browsing_l2cap_cid_for_role(avrcp_role_t role, uint16_t browsing_l2cap_cid);
|
||||
avrcp_browsing_connection_t * get_avrcp_browsing_connection_for_l2cap_cid_for_role(avrcp_role_t role, uint16_t l2cap_cid);
|
||||
avrcp_connection_t * avrcp_get_connection_for_browsing_cid_for_role(avrcp_role_t role, uint16_t browsing_cid);
|
||||
avrcp_connection_t * avrcp_get_connection_for_browsing_l2cap_cid_for_role(avrcp_role_t role, uint16_t browsing_l2cap_cid);
|
||||
avrcp_browsing_connection_t * avrcp_get_browsing_connection_for_l2cap_cid_for_role(avrcp_role_t role, uint16_t l2cap_cid);
|
||||
|
||||
void avrcp_request_can_send_now(avrcp_connection_t * connection, uint16_t l2cap_cid);
|
||||
uint16_t avrcp_get_next_cid(avrcp_role_t role);
|
||||
|
@ -67,9 +67,9 @@ void avrcp_browsing_request_can_send_now(avrcp_browsing_connection_t * connectio
|
||||
|
||||
static void avrcp_reconnect_timer_timeout_handler(btstack_timer_source_t * timer){
|
||||
uint16_t avrcp_cid = (uint16_t)(uintptr_t) btstack_run_loop_get_timer_context(timer);
|
||||
avrcp_connection_t * connection_controller = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
||||
avrcp_connection_t * connection_controller = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_CONTROLLER, avrcp_cid);
|
||||
if (connection_controller == NULL) return;
|
||||
avrcp_connection_t * connection_target = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection_target = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (connection_target == NULL) return;
|
||||
|
||||
if ((connection_controller->browsing_connection == NULL) || (connection_target->browsing_connection == NULL)) return;
|
||||
@ -236,8 +236,8 @@ static void avrcp_browsing_packet_handler(uint8_t packet_type, uint16_t channel,
|
||||
local_cid = l2cap_event_incoming_connection_get_local_cid(packet);
|
||||
outoing_active = false;
|
||||
|
||||
connection_target = get_avrcp_connection_for_bd_addr_for_role(AVRCP_TARGET, event_addr);
|
||||
connection_controller = get_avrcp_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, event_addr);
|
||||
connection_target = avrcp_get_connection_for_bd_addr_for_role(AVRCP_TARGET, event_addr);
|
||||
connection_controller = avrcp_get_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, event_addr);
|
||||
|
||||
if (connection_target == NULL || connection_controller == NULL) {
|
||||
l2cap_decline_connection(local_cid);
|
||||
@ -294,8 +294,8 @@ static void avrcp_browsing_packet_handler(uint8_t packet_type, uint16_t channel,
|
||||
status = l2cap_event_channel_opened_get_status(packet);
|
||||
local_cid = l2cap_event_channel_opened_get_local_cid(packet);
|
||||
|
||||
connection_controller = get_avrcp_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, event_addr);
|
||||
connection_target = get_avrcp_connection_for_bd_addr_for_role(AVRCP_TARGET, event_addr);
|
||||
connection_controller = avrcp_get_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, event_addr);
|
||||
connection_target = avrcp_get_connection_for_bd_addr_for_role(AVRCP_TARGET, event_addr);
|
||||
|
||||
// incoming: structs are already created in L2CAP_EVENT_INCOMING_CONNECTION
|
||||
// outgoing: structs are cteated in avrcp_connect() and avrcp_browsing_connect()
|
||||
@ -335,8 +335,8 @@ static void avrcp_browsing_packet_handler(uint8_t packet_type, uint16_t channel,
|
||||
case L2CAP_EVENT_CHANNEL_CLOSED:
|
||||
local_cid = l2cap_event_channel_closed_get_local_cid(packet);
|
||||
|
||||
connection_controller = get_avrcp_connection_for_browsing_l2cap_cid_for_role(AVRCP_CONTROLLER, local_cid);
|
||||
connection_target = get_avrcp_connection_for_browsing_l2cap_cid_for_role(AVRCP_TARGET, local_cid);
|
||||
connection_controller = avrcp_get_connection_for_browsing_l2cap_cid_for_role(AVRCP_CONTROLLER, local_cid);
|
||||
connection_target = avrcp_get_connection_for_browsing_l2cap_cid_for_role(AVRCP_TARGET, local_cid);
|
||||
if ((connection_controller == NULL) || (connection_target == NULL)) {
|
||||
break;
|
||||
}
|
||||
@ -350,13 +350,13 @@ static void avrcp_browsing_packet_handler(uint8_t packet_type, uint16_t channel,
|
||||
|
||||
case L2CAP_EVENT_CAN_SEND_NOW:
|
||||
local_cid = l2cap_event_can_send_now_get_local_cid(packet);
|
||||
connection_target = get_avrcp_connection_for_browsing_l2cap_cid_for_role(AVRCP_TARGET, local_cid);
|
||||
connection_target = avrcp_get_connection_for_browsing_l2cap_cid_for_role(AVRCP_TARGET, local_cid);
|
||||
if ((connection_target != NULL) && (connection_target->browsing_connection != NULL) && connection_target->browsing_connection->wait_to_send) {
|
||||
connection_target->browsing_connection->wait_to_send = false;
|
||||
(*avrcp_browsing_target_packet_handler)(HCI_EVENT_PACKET, channel, packet, size);
|
||||
break;
|
||||
}
|
||||
connection_controller = get_avrcp_connection_for_browsing_l2cap_cid_for_role(AVRCP_CONTROLLER, local_cid);
|
||||
connection_controller = avrcp_get_connection_for_browsing_l2cap_cid_for_role(AVRCP_CONTROLLER, local_cid);
|
||||
if ((connection_controller != NULL) && (connection_controller->browsing_connection != NULL) && connection_controller->browsing_connection->wait_to_send) {
|
||||
connection_controller->browsing_connection->wait_to_send = false;
|
||||
(*avrcp_browsing_controller_packet_handler)(HCI_EVENT_PACKET, channel, packet, size);
|
||||
@ -387,8 +387,8 @@ static void avrcp_browsing_handle_sdp_client_query_result(uint8_t packet_type, u
|
||||
UNUSED(channel);
|
||||
UNUSED(size);
|
||||
|
||||
avrcp_connection_t * avrcp_target_connection = get_avrcp_connection_for_bd_addr_for_role(AVRCP_TARGET, avrcp_browsing_sdp_addr);
|
||||
avrcp_connection_t * avrcp_controller_connection = get_avrcp_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, avrcp_browsing_sdp_addr);
|
||||
avrcp_connection_t * avrcp_target_connection = avrcp_get_connection_for_bd_addr_for_role(AVRCP_TARGET, avrcp_browsing_sdp_addr);
|
||||
avrcp_connection_t * avrcp_controller_connection = avrcp_get_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, avrcp_browsing_sdp_addr);
|
||||
|
||||
uint8_t status;
|
||||
uint16_t browsing_l2cap_psm;
|
||||
@ -433,11 +433,11 @@ uint8_t avrcp_browsing_connect(bd_addr_t remote_addr, uint8_t * ertm_buffer, uin
|
||||
btstack_assert(avrcp_browsing_controller_packet_handler != NULL);
|
||||
btstack_assert(avrcp_browsing_target_packet_handler != NULL);
|
||||
|
||||
avrcp_connection_t * connection_controller = get_avrcp_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, remote_addr);
|
||||
avrcp_connection_t * connection_controller = avrcp_get_connection_for_bd_addr_for_role(AVRCP_CONTROLLER, remote_addr);
|
||||
if (!connection_controller){
|
||||
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||
}
|
||||
avrcp_connection_t * connection_target = get_avrcp_connection_for_bd_addr_for_role(AVRCP_TARGET, remote_addr);
|
||||
avrcp_connection_t * connection_target = avrcp_get_connection_for_bd_addr_for_role(AVRCP_TARGET, remote_addr);
|
||||
if (!connection_target){
|
||||
return ERROR_CODE_COMMAND_DISALLOWED;
|
||||
}
|
||||
@ -483,11 +483,11 @@ uint8_t avrcp_browsing_connect(bd_addr_t remote_addr, uint8_t * ertm_buffer, uin
|
||||
}
|
||||
|
||||
uint8_t avrcp_browsing_configure_incoming_connection(uint16_t avrcp_browsing_cid, uint8_t * ertm_buffer, uint32_t ertm_buffer_size, l2cap_ertm_config_t * ertm_config){
|
||||
avrcp_connection_t * connection_controller = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * connection_controller = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!connection_controller){
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
avrcp_connection_t * connection_target = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
avrcp_connection_t * connection_target = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
if (!connection_target){
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
@ -518,11 +518,11 @@ uint8_t avrcp_browsing_configure_incoming_connection(uint16_t avrcp_browsing_cid
|
||||
|
||||
|
||||
uint8_t avrcp_browsing_decline_incoming_connection(uint16_t avrcp_browsing_cid){
|
||||
avrcp_connection_t * connection_controller = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * connection_controller = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!connection_controller){
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
avrcp_connection_t * connection_target = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
avrcp_connection_t * connection_target = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
if (!connection_target){
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
@ -546,11 +546,11 @@ uint8_t avrcp_browsing_decline_incoming_connection(uint16_t avrcp_browsing_cid){
|
||||
}
|
||||
|
||||
uint8_t avrcp_browsing_disconnect(uint16_t avrcp_browsing_cid){
|
||||
avrcp_connection_t * connection_controller = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * connection_controller = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!connection_controller){
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
avrcp_connection_t * connection_target = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
avrcp_connection_t * connection_target = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
if (!connection_target){
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
}
|
||||
|
@ -378,7 +378,7 @@ static void avrcp_browsing_controller_packet_handler(uint8_t packet_type, uint16
|
||||
int pos;
|
||||
switch (packet_type) {
|
||||
case L2CAP_DATA_PACKET:
|
||||
browsing_connection = get_avrcp_browsing_connection_for_l2cap_cid_for_role(AVRCP_CONTROLLER, channel);
|
||||
browsing_connection = avrcp_get_browsing_connection_for_l2cap_cid_for_role(AVRCP_CONTROLLER, channel);
|
||||
if (!browsing_connection) break;
|
||||
pos = 0;
|
||||
transport_header = packet[pos++];
|
||||
@ -492,7 +492,7 @@ static void avrcp_browsing_controller_packet_handler(uint8_t packet_type, uint16
|
||||
case HCI_EVENT_PACKET:
|
||||
switch (hci_event_packet_get_type(packet)){
|
||||
case L2CAP_EVENT_CAN_SEND_NOW:
|
||||
browsing_connection = get_avrcp_browsing_connection_for_l2cap_cid_for_role(AVRCP_CONTROLLER,channel);
|
||||
browsing_connection = avrcp_get_browsing_connection_for_l2cap_cid_for_role(AVRCP_CONTROLLER,channel);
|
||||
avrcp_browsing_controller_handle_can_send_now(browsing_connection);
|
||||
break;
|
||||
default:
|
||||
@ -516,7 +516,7 @@ void avrcp_browsing_controller_register_packet_handler(btstack_packet_handler_t
|
||||
}
|
||||
|
||||
uint8_t avrcp_browsing_controller_get_item_attributes_for_scope(uint16_t avrcp_browsing_cid, uint8_t * uid, uint16_t uid_counter, uint32_t attr_bitmap, avrcp_browsing_scope_t scope){
|
||||
avrcp_connection_t * avrcp_connection = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * avrcp_connection = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!avrcp_connection){
|
||||
log_error("avrcp_browsing_controller_get_item_attributes: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -546,7 +546,7 @@ uint8_t avrcp_browsing_controller_get_item_attributes_for_scope(uint16_t avrcp_b
|
||||
* @param attribute_list
|
||||
**/
|
||||
static uint8_t avrcp_browsing_controller_get_folder_items(uint16_t avrcp_browsing_cid, avrcp_browsing_scope_t scope, uint32_t start_item, uint32_t end_item, uint32_t attr_bitmap){
|
||||
avrcp_connection_t * avrcp_connection = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * avrcp_connection = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!avrcp_connection){
|
||||
log_error("avrcp_browsing_controller_disconnect: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -587,7 +587,7 @@ uint8_t avrcp_browsing_controller_browse_now_playing_list(uint16_t avrcp_browsin
|
||||
|
||||
|
||||
uint8_t avrcp_browsing_controller_set_browsed_player(uint16_t avrcp_browsing_cid, uint16_t browsed_player_id){
|
||||
avrcp_connection_t * avrcp_connection = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * avrcp_connection = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!avrcp_connection){
|
||||
log_error("avrcp_browsing_controller_change_path: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -611,7 +611,7 @@ uint8_t avrcp_browsing_controller_set_browsed_player(uint16_t avrcp_browsing_cid
|
||||
* @param folder_uid 8 bytes long
|
||||
**/
|
||||
uint8_t avrcp_browsing_controller_change_path(uint16_t avrcp_browsing_cid, uint8_t direction, uint8_t * folder_uid){
|
||||
avrcp_connection_t * avrcp_connection = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * avrcp_connection = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!avrcp_connection){
|
||||
log_error("avrcp_browsing_controller_change_path: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -648,7 +648,7 @@ uint8_t avrcp_browsing_controller_go_down_one_level(uint16_t avrcp_browsing_cid,
|
||||
}
|
||||
|
||||
uint8_t avrcp_browsing_controller_search(uint16_t avrcp_browsing_cid, uint16_t search_str_len, char * search_str){
|
||||
avrcp_connection_t * avrcp_connection = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * avrcp_connection = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!avrcp_connection){
|
||||
log_error("avrcp_browsing_controller_change_path: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -680,7 +680,7 @@ uint8_t avrcp_browsing_controller_search(uint16_t avrcp_browsing_cid, uint16_t s
|
||||
}
|
||||
|
||||
uint8_t avrcp_browsing_controller_get_total_nr_items_for_scope(uint16_t avrcp_browsing_cid, avrcp_browsing_scope_t scope){
|
||||
avrcp_connection_t * avrcp_connection = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
avrcp_connection_t * avrcp_connection = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_CONTROLLER, avrcp_browsing_cid);
|
||||
if (!avrcp_connection){
|
||||
log_error("avrcp_browsing_controller_change_path: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
|
@ -122,7 +122,7 @@ static void avrcp_browsing_target_packet_handler(uint8_t packet_type, uint16_t c
|
||||
|
||||
switch (packet_type) {
|
||||
case L2CAP_DATA_PACKET:{
|
||||
browsing_connection = get_avrcp_browsing_connection_for_l2cap_cid_for_role(AVRCP_TARGET, channel);
|
||||
browsing_connection = avrcp_get_browsing_connection_for_l2cap_cid_for_role(AVRCP_TARGET, channel);
|
||||
if (!browsing_connection) break;
|
||||
int pos = 0;
|
||||
uint8_t transport_header = packet[pos++];
|
||||
@ -187,7 +187,7 @@ static void avrcp_browsing_target_packet_handler(uint8_t packet_type, uint16_t c
|
||||
case HCI_EVENT_PACKET:
|
||||
switch (hci_event_packet_get_type(packet)){
|
||||
case L2CAP_EVENT_CAN_SEND_NOW:
|
||||
browsing_connection = get_avrcp_browsing_connection_for_l2cap_cid_for_role(AVRCP_TARGET, channel);
|
||||
browsing_connection = avrcp_get_browsing_connection_for_l2cap_cid_for_role(AVRCP_TARGET, channel);
|
||||
if (browsing_connection->state != AVCTP_W2_SEND_RESPONSE) return;
|
||||
browsing_connection->state = AVCTP_CONNECTION_OPENED;
|
||||
avrcp_browsing_target_handle_can_send_now(browsing_connection);
|
||||
@ -213,7 +213,7 @@ void avrcp_browsing_target_register_packet_handler(btstack_packet_handler_t call
|
||||
}
|
||||
|
||||
uint8_t avrcp_browsing_target_send_get_folder_items_response(uint16_t avrcp_browsing_cid, uint16_t uid_counter, uint8_t * attr_list, uint16_t attr_list_size){
|
||||
avrcp_connection_t * avrcp_connection = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
avrcp_connection_t * avrcp_connection = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
if (!avrcp_connection){
|
||||
log_error("Could not find an AVRCP Target connection for browsing_cid 0x%02x.", avrcp_browsing_cid);
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -256,7 +256,7 @@ uint8_t avrcp_browsing_target_send_get_folder_items_response(uint16_t avrcp_brow
|
||||
|
||||
|
||||
uint8_t avrcp_browsing_target_send_get_total_num_items_response(uint16_t avrcp_browsing_cid, uint16_t uid_counter, uint32_t total_num_items){
|
||||
avrcp_connection_t * avrcp_connection = get_avrcp_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
avrcp_connection_t * avrcp_connection = avrcp_get_connection_for_browsing_cid_for_role(AVRCP_TARGET, avrcp_browsing_cid);
|
||||
if (!avrcp_connection){
|
||||
log_error("Could not find an AVRCP Target connection for browsing_cid 0x%02x.", avrcp_browsing_cid);
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
|
@ -123,7 +123,7 @@ static uint8_t request_pass_through_release_control_cmd(avrcp_connection_t * con
|
||||
}
|
||||
|
||||
static inline uint8_t request_pass_through_press_control_cmd(uint16_t avrcp_cid, avrcp_operation_id_t opid, uint16_t playback_speed, uint8_t continuous_fast_forward_cmd){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp: could not find a connection. avrcp cid 0x%02x", avrcp_cid);
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -969,14 +969,14 @@ static void avrcp_controller_packet_handler(uint8_t packet_type, uint16_t channe
|
||||
|
||||
switch (packet_type) {
|
||||
case L2CAP_DATA_PACKET:
|
||||
connection = get_avrcp_connection_for_l2cap_signaling_cid_for_role(AVRCP_CONTROLLER, channel);
|
||||
connection = avrcp_get_connection_for_l2cap_signaling_cid_for_role(AVRCP_CONTROLLER, channel);
|
||||
avrcp_handle_l2cap_data_packet_for_signaling_connection(connection, packet, size);
|
||||
break;
|
||||
|
||||
case HCI_EVENT_PACKET:
|
||||
switch (hci_event_packet_get_type(packet)){
|
||||
case L2CAP_EVENT_CAN_SEND_NOW:
|
||||
connection = get_avrcp_connection_for_l2cap_signaling_cid_for_role(AVRCP_CONTROLLER, channel);
|
||||
connection = avrcp_get_connection_for_l2cap_signaling_cid_for_role(AVRCP_CONTROLLER, channel);
|
||||
avrcp_controller_handle_can_send_now(connection);
|
||||
break;
|
||||
default:
|
||||
@ -999,7 +999,7 @@ void avrcp_controller_register_packet_handler(btstack_packet_handler_t callback)
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_unit_info(uint16_t avrcp_cid){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_unit_info: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1019,7 +1019,7 @@ uint8_t avrcp_controller_unit_info(uint16_t avrcp_cid){
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_subunit_info(uint16_t avrcp_cid){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_unit_info: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1040,7 +1040,7 @@ uint8_t avrcp_controller_subunit_info(uint16_t avrcp_cid){
|
||||
}
|
||||
|
||||
static uint8_t avrcp_controller_get_capabilities(uint16_t avrcp_cid, uint8_t capability_id){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_capabilities: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1120,7 +1120,7 @@ uint8_t avrcp_controller_rewind(uint16_t avrcp_cid){
|
||||
/* start cmds */
|
||||
|
||||
uint8_t avrcp_controller_release_press_and_hold_cmd(uint16_t avrcp_cid){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_stop_play: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1164,7 +1164,7 @@ uint8_t avrcp_controller_press_and_hold_mute(uint16_t avrcp_cid){
|
||||
/* stop continuous cmds */
|
||||
|
||||
uint8_t avrcp_controller_get_play_status(uint16_t avrcp_cid){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_play_status: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1186,7 +1186,7 @@ uint8_t avrcp_controller_get_play_status(uint16_t avrcp_cid){
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_enable_notification(uint16_t avrcp_cid, avrcp_notification_event_id_t event_id){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_play_status: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1196,7 +1196,7 @@ uint8_t avrcp_controller_enable_notification(uint16_t avrcp_cid, avrcp_notificat
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_disable_notification(uint16_t avrcp_cid, avrcp_notification_event_id_t event_id){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_play_status: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1206,7 +1206,7 @@ uint8_t avrcp_controller_disable_notification(uint16_t avrcp_cid, avrcp_notifica
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_set_addressed_player(uint16_t avrcp_cid, uint16_t addressed_player_id){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_capabilities: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1238,7 +1238,7 @@ uint8_t avrcp_controller_set_addressed_player(uint16_t avrcp_cid, uint16_t addre
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_get_now_playing_info(uint16_t avrcp_cid){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_capabilities: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1274,7 +1274,7 @@ uint8_t avrcp_controller_get_now_playing_info(uint16_t avrcp_cid){
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_set_absolute_volume(uint16_t avrcp_cid, uint8_t volume){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_capabilities: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1304,7 +1304,7 @@ uint8_t avrcp_controller_set_absolute_volume(uint16_t avrcp_cid, uint8_t volume)
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_query_shuffle_and_repeat_modes(uint16_t avrcp_cid){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_capabilities: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1333,7 +1333,7 @@ uint8_t avrcp_controller_query_shuffle_and_repeat_modes(uint16_t avrcp_cid){
|
||||
}
|
||||
|
||||
static uint8_t avrcp_controller_set_current_player_application_setting_value(uint16_t avrcp_cid, uint8_t attr_id, uint8_t attr_value){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_get_capabilities: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1374,7 +1374,7 @@ uint8_t avrcp_controller_set_repeat_mode(uint16_t avrcp_cid, avrcp_repeat_mode_t
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_play_item_for_scope(uint16_t avrcp_cid, uint8_t * uid, uint16_t uid_counter, avrcp_browsing_scope_t scope){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("Could not find a connection with cid 0%02x.", avrcp_cid);
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1414,7 +1414,7 @@ uint8_t avrcp_controller_play_item_for_scope(uint16_t avrcp_cid, uint8_t * uid,
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_add_item_from_scope_to_now_playing_list(uint16_t avrcp_cid, uint8_t * uid, uint16_t uid_counter, avrcp_browsing_scope_t scope){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("Could not find a connection with cid 0%02x.", avrcp_cid);
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1454,7 +1454,7 @@ uint8_t avrcp_controller_add_item_from_scope_to_now_playing_list(uint16_t avrcp_
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_set_max_num_fragments(uint16_t avrcp_cid, uint8_t max_num_fragments){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_controller_play_item: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1464,7 +1464,7 @@ uint8_t avrcp_controller_set_max_num_fragments(uint16_t avrcp_cid, uint8_t max_n
|
||||
}
|
||||
|
||||
uint8_t avrcp_controller_send_custom_command(uint16_t avrcp_cid, avrcp_command_type_t command_type, avrcp_subunit_type_t subunit_type, avrcp_subunit_id_t subunit_id, avrcp_command_opcode_t command_opcode, const uint8_t * command_buffer, uint16_t command_len){
|
||||
avrcp_connection_t * connection = get_avrcp_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){
|
||||
log_error("avrcp_controller_play_item: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
|
@ -433,7 +433,7 @@ static uint8_t avrcp_target_response_addressed_player_changed_interim(avrcp_conn
|
||||
}
|
||||
|
||||
static uint8_t avrcp_target_pass_through_response(uint16_t avrcp_cid, avrcp_command_type_t cmd_type, avrcp_operation_id_t opid, uint8_t operands_length, uint8_t operand){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("Could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -466,7 +466,7 @@ uint8_t avrcp_target_operation_not_implemented(uint16_t avrcp_cid, avrcp_operati
|
||||
}
|
||||
|
||||
void avrcp_target_set_unit_info(uint16_t avrcp_cid, avrcp_subunit_type_t unit_type, uint32_t company_id){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_target_set_unit_info: could not find a connection.");
|
||||
return;
|
||||
@ -476,7 +476,7 @@ void avrcp_target_set_unit_info(uint16_t avrcp_cid, avrcp_subunit_type_t unit_ty
|
||||
}
|
||||
|
||||
void avrcp_target_set_subunit_info(uint16_t avrcp_cid, avrcp_subunit_type_t subunit_type, const uint8_t * subunit_info_data, uint16_t subunit_info_data_size){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_target_set_subunit_info: could not find a connection.");
|
||||
return;
|
||||
@ -531,7 +531,7 @@ static uint8_t avrcp_target_subunit_info(avrcp_connection_t * connection, uint8_
|
||||
}
|
||||
|
||||
static inline uint8_t avrcp_prepare_vendor_dependent_response(uint16_t avrcp_cid, avrcp_connection_t ** out_connection, avrcp_pdu_id_t pdu_id, uint16_t param_length){
|
||||
*out_connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
*out_connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!*out_connection){
|
||||
log_error("avrcp tartget: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -615,7 +615,7 @@ static uint8_t avrcp_target_store_media_attr(avrcp_connection_t * connection, av
|
||||
}
|
||||
|
||||
uint8_t avrcp_target_set_playback_status(uint16_t avrcp_cid, avrcp_playback_status_t playback_status){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_unit_info: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -629,7 +629,7 @@ uint8_t avrcp_target_set_playback_status(uint16_t avrcp_cid, avrcp_playback_stat
|
||||
}
|
||||
|
||||
void avrcp_target_set_now_playing_info(uint16_t avrcp_cid, const avrcp_track_t * current_track, uint16_t total_tracks){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_unit_info: could not find a connection. cid 0x%02x\n", avrcp_cid);
|
||||
return;
|
||||
@ -657,7 +657,7 @@ void avrcp_target_set_now_playing_info(uint16_t avrcp_cid, const avrcp_track_t *
|
||||
}
|
||||
|
||||
uint8_t avrcp_target_track_changed(uint16_t avrcp_cid, uint8_t * track_id){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_target_track_changed: could not find connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -673,7 +673,7 @@ uint8_t avrcp_target_track_changed(uint16_t avrcp_cid, uint8_t * track_id){
|
||||
}
|
||||
|
||||
uint8_t avrcp_target_playing_content_changed(uint16_t avrcp_cid){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_target_playing_content_changed: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -686,7 +686,7 @@ uint8_t avrcp_target_playing_content_changed(uint16_t avrcp_cid){
|
||||
}
|
||||
|
||||
uint8_t avrcp_target_addressed_player_changed(uint16_t avrcp_cid, uint16_t player_id, uint16_t uid_counter){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_unit_info: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -699,7 +699,7 @@ uint8_t avrcp_target_addressed_player_changed(uint16_t avrcp_cid, uint16_t playe
|
||||
}
|
||||
|
||||
uint8_t avrcp_target_battery_status_changed(uint16_t avrcp_cid, avrcp_battery_status_t battery_status){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_unit_info: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -714,7 +714,7 @@ uint8_t avrcp_target_battery_status_changed(uint16_t avrcp_cid, avrcp_battery_st
|
||||
}
|
||||
|
||||
uint8_t avrcp_target_volume_changed(uint16_t avrcp_cid, uint8_t volume_percentage){
|
||||
avrcp_connection_t * connection = get_avrcp_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
avrcp_connection_t * connection = avrcp_get_connection_for_avrcp_cid_for_role(AVRCP_TARGET, avrcp_cid);
|
||||
if (!connection){
|
||||
log_error("avrcp_unit_info: could not find a connection.");
|
||||
return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER;
|
||||
@ -1073,13 +1073,13 @@ static void avrcp_target_packet_handler(uint8_t packet_type, uint16_t channel, u
|
||||
avrcp_connection_t * connection;
|
||||
switch (packet_type) {
|
||||
case L2CAP_DATA_PACKET:
|
||||
connection = get_avrcp_connection_for_l2cap_signaling_cid_for_role(AVRCP_TARGET, channel);
|
||||
connection = avrcp_get_connection_for_l2cap_signaling_cid_for_role(AVRCP_TARGET, channel);
|
||||
avrcp_handle_l2cap_data_packet_for_signaling_connection(connection, packet, size);
|
||||
break;
|
||||
case HCI_EVENT_PACKET:
|
||||
switch (hci_event_packet_get_type(packet)){
|
||||
case L2CAP_EVENT_CAN_SEND_NOW:{
|
||||
connection = get_avrcp_connection_for_l2cap_signaling_cid_for_role(AVRCP_TARGET, channel);
|
||||
connection = avrcp_get_connection_for_l2cap_signaling_cid_for_role(AVRCP_TARGET, channel);
|
||||
|
||||
if (connection->accept_response){
|
||||
connection->accept_response = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user