From d713a683b276343856dc8a837f0eceb10d3bf19c Mon Sep 17 00:00:00 2001 From: "matthias.ringwald@gmail.com" Date: Thu, 14 Aug 2014 13:02:55 +0000 Subject: [PATCH] use hci_can_send_prepared_acl_packet_now instead of hci_number_free_acl_slots --- src/hci.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hci.c b/src/hci.c index 4962235d3..266ffec93 100644 --- a/src/hci.c +++ b/src/hci.c @@ -346,15 +346,16 @@ int hci_send_acl_packet_buffer(int size){ return 0; } + uint8_t * packet = hci_stack->hci_packet_buffer; + hci_con_handle_t con_handle = READ_ACL_CONNECTION_HANDLE(packet); + // check for free places on Bluetooth module - if (!hci_number_free_acl_slots()) { + if (!hci_can_send_prepared_acl_packet_now(con_handle)) { log_error("hci_send_acl_packet_buffer called but no free ACL buffers on controller"); hci_release_packet_buffer(); return BTSTACK_ACL_BUFFERS_FULL; } - uint8_t * packet = hci_stack->hci_packet_buffer; - hci_con_handle_t con_handle = READ_ACL_CONNECTION_HANDLE(packet); hci_connection_t *connection = hci_connection_for_handle( con_handle); if (!connection) { log_error("hci_send_acl_packet_buffer called but no connection for handle 0x%04x", con_handle);