mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-27 06:35:20 +00:00
block all new l2cap credits if a connection gets blocked
This commit is contained in:
parent
f52b01709e
commit
b06a83cf1f
@ -317,10 +317,16 @@ static int daemon_client_handler(connection_t *connection, uint16_t packet_type,
|
|||||||
case L2CAP_DATA_PACKET:
|
case L2CAP_DATA_PACKET:
|
||||||
// process l2cap packet...
|
// process l2cap packet...
|
||||||
err = l2cap_send_internal(channel, data, length);
|
err = l2cap_send_internal(channel, data, length);
|
||||||
|
if (err == BTSTACK_ACL_BUFFERS_FULL) {
|
||||||
|
l2cap_block_new_credits(1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case RFCOMM_DATA_PACKET:
|
case RFCOMM_DATA_PACKET:
|
||||||
// process l2cap packet...
|
// process l2cap packet...
|
||||||
err = rfcomm_send_internal(channel, data, length);
|
err = rfcomm_send_internal(channel, data, length);
|
||||||
|
if (err == BTSTACK_ACL_BUFFERS_FULL) {
|
||||||
|
l2cap_block_new_credits(1);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case DAEMON_EVENT_PACKET:
|
case DAEMON_EVENT_PACKET:
|
||||||
switch (data[0]) {
|
switch (data[0]) {
|
||||||
@ -407,6 +413,9 @@ static void daemon_packet_handler(void * connection, uint8_t packet_type, uint16
|
|||||||
deamon_status_event_handler(packet, size);
|
deamon_status_event_handler(packet, size);
|
||||||
if (packet[0] == HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS) {
|
if (packet[0] == HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS) {
|
||||||
socket_connection_retry_parked();
|
socket_connection_retry_parked();
|
||||||
|
if (!socket_connection_has_parked_connections()){
|
||||||
|
l2cap_block_new_credits(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (connection) {
|
if (connection) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user