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

Commit 5792b388 authored by Joseph Hwang's avatar Joseph Hwang
Browse files

gd/hal: add getMsftOpcode to hci_hal_host

The getMsftOpcode function gets the MSFT opcode on Linux based
hosts. On non-Linux platforms, the returned 0 indicates MSFT
extension is not supported.

Bug: 246398494
Tag: #floss
Test: ./build.py --target test
Test: Manual test with next patch.

Change-Id: Ia6abf1ddaab7cd1b2f026323770d6fe8e1ab6a90
parent 13ce51da
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -97,6 +97,12 @@ class HciHal : public ::bluetooth::Module {
  // V5.2, Vol 4, Part E, Section 5.4.5) to the Bluetooth controller.
  // Packets must be processed in order.
  virtual void sendIsoData(HciPacket data) = 0;

  // Get the MSFT opcode (as specified in Microsoft-defined Bluetooth HCI
  // extensions)
  virtual uint16_t getMsftOpcode() {
    return 0;
  }
};
// LINT.ThenChange(fuzz/fuzz_hci_hal.h)

+5 −0
Original line number Diff line number Diff line
@@ -30,6 +30,7 @@

#include "gd/common/init_flags.h"
#include "hal/hci_hal.h"
#include "hal/mgmt.h"
#include "hal/snoop_logger.h"
#include "metrics/counter_metrics.h"
#include "os/log.h"
@@ -266,6 +267,10 @@ class HciHalHost : public HciHal {
    write_to_fd(packet);
  }

  uint16_t getMsftOpcode() override {
    return Mgmt().get_vs_opcode(MGMT_VS_OPCODE_MSFT);
  }

 protected:
  void ListDependencies(ModuleList* list) const {
    list->add<metrics::CounterMetrics>();