Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 785876e4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Initialize ras only if the controller support channel soudning." into main

parents 43bb005e fe9a28c6
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@
#include "bta/include/bta_gatt_api.h"
#include "bta/include/bta_ras_api.h"
#include "bta/ras/ras_types.h"
#include "gd/hci/controller_interface.h"
#include "main/shim/entry.h"
#include "os/logging/log_adapter.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_ble_addr.h"
@@ -100,6 +102,11 @@ public:
  };

  void Initialize() override {
    auto controller = bluetooth::shim::GetController();
    if (controller && !controller->SupportsBleChannelSounding()) {
      log::info("controller does not support channel sounding.");
      return;
    }
    BTA_GATTC_AppRegister(
            [](tBTA_GATTC_EVT event, tBTA_GATTC* p_data) {
              if (instance && p_data) {
+8 −2
Original line number Diff line number Diff line
@@ -23,8 +23,10 @@
#include "bta/include/bta_gatt_api.h"
#include "bta/include/bta_ras_api.h"
#include "bta/ras/ras_types.h"
#include "gd/hci/controller_interface.h"
#include "gd/hci/uuid.h"
#include "gd/os/rand.h"
#include "main/shim/entry.h"
#include "os/logging/log_adapter.h"
#include "stack/include/bt_types.h"
#include "stack/include/btm_ble_addr.h"
@@ -74,11 +76,15 @@ public:
    uint16_t last_overwritten_procedure_ = 0;
  };

  void Initialize() {
  void Initialize() override {
    auto controller = bluetooth::shim::GetController();
    if (controller && !controller->SupportsBleChannelSounding()) {
      log::info("controller does not support channel sounding.");
      return;
    }
    Uuid uuid = Uuid::From128BitBE(bluetooth::os::GenerateRandom<Uuid::kNumBytes128>());
    app_uuid_ = uuid;
    log::info("Register server with uuid:{}", app_uuid_.ToString());

    BTA_GATTS_AppRegister(
            app_uuid_,
            [](tBTA_GATTS_EVT event, tBTA_GATTS* p_data) {