From 6ad0718fa87dfbaa2bd95ab23f60f485a896e84b Mon Sep 17 00:00:00 2001 From: nyyu Date: Fri, 30 Sep 2022 22:40:43 +0200 Subject: [PATCH] bt: disable le Change-Id: I5c258b1401fcd6fbfa98c98849db209688f52d3c --- system/gd/hci/controller.cc | 13 +++++++------ system/gd/hci/hci_layer.cc | 4 ++-- system/stack/btm/btm_ble_gap.cc | 4 +++- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/system/gd/hci/controller.cc b/system/gd/hci/controller.cc index dbece21c6e..572df09bce 100644 --- a/system/gd/hci/controller.cc +++ b/system/gd/hci/controller.cc @@ -145,8 +145,9 @@ struct Controller::impl { handler->BindOnceOn(this, &Controller::impl::le_set_host_feature_handler)); } - hci_->EnqueueCommand(LeGetVendorCapabilitiesBuilder::Create(), - handler->BindOnceOn(this, &Controller::impl::le_get_vendor_capabilities_handler)); + /*hci_->EnqueueCommand(LeGetVendorCapabilitiesBuilder::Create(), + handler->BindOnceOn(this, &Controller::impl::le_get_vendor_capabilities_handler));*/ + le_get_vendor_capabilities_handler(); // We only need to synchronize the last read. Make BD_ADDR to be the last one. std::promise promise; @@ -400,8 +401,8 @@ struct Controller::impl { le_periodic_advertiser_list_size_ = complete_view.GetPeriodicAdvertiserListSize(); } - void le_get_vendor_capabilities_handler(CommandCompleteView view) { - auto complete_view = LeGetVendorCapabilitiesCompleteView::Create(view); + void le_get_vendor_capabilities_handler(/*CommandCompleteView view*/) { + //auto complete_view = LeGetVendorCapabilitiesCompleteView::Create(view); vendor_capabilities_.is_supported_ = 0x00; vendor_capabilities_.max_advt_instances_ = 0x00; @@ -420,7 +421,7 @@ struct Controller::impl { vendor_capabilities_.a2dp_source_offload_capability_mask_ = 0x00; vendor_capabilities_.bluetooth_quality_report_support_ = 0x00; - if (complete_view.IsValid()) { + /*if (complete_view.IsValid()) { vendor_capabilities_.is_supported_ = 0x01; // v0.55 @@ -471,7 +472,7 @@ struct Controller::impl { } vendor_capabilities_.a2dp_source_offload_capability_mask_ = v98.GetA2dpSourceOffloadCapabilityMask(); vendor_capabilities_.bluetooth_quality_report_support_ = v98.GetBluetoothQualityReportSupport(); - } + }*/ } void set_event_mask(uint64_t event_mask) { diff --git a/system/gd/hci/hci_layer.cc b/system/gd/hci/hci_layer.cc index b5a9d065be..fa0be65701 100644 --- a/system/gd/hci/hci_layer.cc +++ b/system/gd/hci/hci_layer.cc @@ -180,8 +180,8 @@ struct HciLayer::impl { LOG_ERROR("Discarding event that came after timeout 0x%02hx (%s)", op_code, OpCodeText(op_code).c_str()); return; } - ASSERT_LOG(waiting_command_ == op_code, "Waiting for 0x%02hx (%s), got 0x%02hx (%s)", waiting_command_, - OpCodeText(waiting_command_).c_str(), op_code, OpCodeText(op_code).c_str()); + /*ASSERT_LOG(waiting_command_ == op_code, "Waiting for 0x%02hx (%s), got 0x%02hx (%s)", waiting_command_, + OpCodeText(waiting_command_).c_str(), op_code, OpCodeText(op_code).c_str());*/ bool is_vendor_specific = static_cast(op_code) & (0x3f << 10); CommandStatusView status_view = CommandStatusView::Create(event); diff --git a/system/stack/btm/btm_ble_gap.cc b/system/stack/btm/btm_ble_gap.cc index 76f6c6f62c..4d7f10312c 100644 --- a/system/stack/btm/btm_ble_gap.cc +++ b/system/stack/btm/btm_ble_gap.cc @@ -619,7 +619,9 @@ static void btm_ble_vendor_capability_vsc_cmpl_cback( BTM_TRACE_DEBUG("%s", __func__); /* Check status of command complete event */ - CHECK(p_vcs_cplt_params->opcode == HCI_BLE_VENDOR_CAP); + if(p_vcs_cplt_params->opcode != HCI_BLE_VENDOR_CAP) + return; + CHECK(p_vcs_cplt_params->param_len > 0); const uint8_t* p = p_vcs_cplt_params->p_param_buf; -- 2.37.3