mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-01 01:13:23 +00:00
avrcp: use bool for wait_to_send
This commit is contained in:
parent
eab0c1ee59
commit
cf36dea074
@ -379,8 +379,7 @@ avrcp_browsing_connection_t * get_avrcp_browsing_connection_for_l2cap_cid_for_ro
|
||||
}
|
||||
|
||||
void avrcp_request_can_send_now(avrcp_connection_t * connection, uint16_t l2cap_cid){
|
||||
// printf("AVRCP: avrcp_request_can_send_now, role %d\n", connection->role);
|
||||
connection->wait_to_send = 1;
|
||||
connection->wait_to_send = true;
|
||||
l2cap_request_can_send_now_event(l2cap_cid);
|
||||
}
|
||||
|
||||
@ -820,15 +819,15 @@ static void avrcp_packet_handler(uint8_t packet_type, uint16_t channel, uint8_t
|
||||
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);
|
||||
if (connection_target && connection_target->wait_to_send){
|
||||
connection_target->wait_to_send = 0;
|
||||
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);
|
||||
if (connection_controller && connection_controller->wait_to_send){
|
||||
connection_controller->wait_to_send = 0;
|
||||
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);
|
||||
break;
|
||||
}
|
||||
|
@ -413,7 +413,7 @@ typedef struct {
|
||||
avrcp_browsing_connection_t * browsing_connection;
|
||||
|
||||
avctp_connection_state_t state;
|
||||
uint8_t wait_to_send;
|
||||
bool wait_to_send;
|
||||
|
||||
// PID check
|
||||
uint8_t reject_transport_header;
|
||||
|
@ -327,7 +327,7 @@ static int avrcp_target_send_response(uint16_t cid, avrcp_connection_t * connect
|
||||
connection->cmd_operands_length);
|
||||
pos += connection->cmd_operands_length;
|
||||
|
||||
connection->wait_to_send = 0;
|
||||
connection->wait_to_send = false;
|
||||
return l2cap_send_prepared(cid, pos);
|
||||
}
|
||||
|
||||
@ -1050,7 +1050,7 @@ static int avrcp_target_send_notification(uint16_t cid, avrcp_connection_t * con
|
||||
packet[pos++] = notification_id;
|
||||
(void)memcpy(packet + pos, value, caped_value_len - 1);
|
||||
pos += caped_value_len - 1;
|
||||
connection->wait_to_send = 0;
|
||||
connection->wait_to_send = false;
|
||||
return l2cap_send_prepared(cid, pos);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user