From bc804351d8e8b656e8bfa43207a1aaaa8823211d Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Sat, 18 Jun 2011 12:45:22 +0000 Subject: [PATCH] retry also on RFCOMM_EVENT_CREDITS --- src/daemon.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/daemon.c b/src/daemon.c index 01141294d..aa4045812 100644 --- a/src/daemon.c +++ b/src/daemon.c @@ -411,11 +411,18 @@ static void deamon_status_event_handler(uint8_t *packet, uint16_t size){ static void daemon_packet_handler(void * connection, uint8_t packet_type, uint16_t channel, uint8_t *packet, uint16_t size){ if (packet_type == HCI_EVENT_PACKET) { deamon_status_event_handler(packet, size); - if (packet[0] == HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS) { - socket_connection_retry_parked(); - if (!socket_connection_has_parked_connections()){ - l2cap_block_new_credits(0); - } + switch (packet[0]){ + // ACL buffer freed... + case HCI_EVENT_NUMBER_OF_COMPLETED_PACKETS: + // RFCOMM CREDITS received... + case RFCOMM_EVENT_CREDITS: + // ... try sending again + socket_connection_retry_parked(); + if (!socket_connection_has_parked_connections()){ + l2cap_block_new_credits(0); + } + default: + break; } } if (connection) {