From 42a3fb75c3258a084146e6f95bb649cf9e4f566e Mon Sep 17 00:00:00 2001 From: Chih-Wei Huang Date: Fri, 14 Feb 2020 13:15:13 +0800 Subject: [PATCH] Avoid more annoying crashing --- device/src/controller.c | 5 ++++- hci/src/packet_fragmenter.c | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/device/src/controller.c b/device/src/controller.c index 5cb0d54c1..14a9689e3 100644 --- a/device/src/controller.c +++ b/device/src/controller.c @@ -28,6 +28,7 @@ #include "btcore/include/version.h" #include "hcimsgs.h" #include "osi/include/future.h" +#include "osi/include/log.h" #include "stack/include/btm_ble_api.h" const bt_event_mask_t BLE_EVENT_MASK = { "\x00\x00\x00\x00\x00\x00\x06\x7f" }; @@ -252,7 +253,9 @@ static future_t *start_up(void) { &number_of_local_supported_codecs, local_supported_codecs); } - assert(HCI_READ_ENCR_KEY_SIZE_SUPPORTED(supported_commands)); + if (!HCI_READ_ENCR_KEY_SIZE_SUPPORTED(supported_commands)) { + LOG_WARN(LOG_TAG, "Controller doesn't support Read Encryption Key Size command"); + } readable = true; return future_new_immediate(FUTURE_SUCCESS); diff --git a/hci/src/packet_fragmenter.c b/hci/src/packet_fragmenter.c index eae6905d6..a21d73390 100644 --- a/hci/src/packet_fragmenter.c +++ b/hci/src/packet_fragmenter.c @@ -135,8 +135,6 @@ static void reassemble_and_dispatch(UNUSED_ATTR BT_HDR *packet) { STREAM_TO_UINT16(acl_length, stream); STREAM_TO_UINT16(l2cap_length, stream); - assert(acl_length == packet->len - HCI_ACL_PREAMBLE_SIZE); - uint8_t boundary_flag = GET_BOUNDARY_FLAG(handle); handle = handle & HANDLE_MASK; -- 2.11.0