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

Commit 6ffc946a authored by Chris Manton's avatar Chris Manton
Browse files

Create swappable controller connection

Bug: 140419695
Test: Run sdp query on walleye with Gd disabled
Change-Id: I7f608a06399d38e88282ab85a629085cf2756d26
parent b0ecaa79
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -89,6 +89,12 @@ typedef struct controller_t {

} controller_t;

namespace bluetooth {
namespace legacy {
const controller_t* controller_get_interface();
}  // namespace legacy
}  // namespace bluetooth

const controller_t* controller_get_interface();

const controller_t* controller_get_test_interface(
+11 −1
Original line number Diff line number Diff line
@@ -27,6 +27,8 @@
#include "btcore/include/module.h"
#include "btcore/include/version.h"
#include "hcimsgs.h"
#include "main/shim/controller.h"
#include "main/shim/shim.h"
#include "osi/include/future.h"
#include "stack/include/btm_ble_api.h"

@@ -582,7 +584,7 @@ static const controller_t interface = {
    get_local_supported_codecs,
    get_le_all_initiating_phys};

const controller_t* controller_get_interface() {
const controller_t* bluetooth::legacy::controller_get_interface() {
  static bool loaded = false;
  if (!loaded) {
    loaded = true;
@@ -595,6 +597,14 @@ const controller_t* controller_get_interface() {
  return &interface;
}

const controller_t* controller_get_interface() {
  if (bluetooth::shim::is_gd_shim_enabled()) {
    return bluetooth::shim::controller_get_interface();
  } else {
    return bluetooth::legacy::controller_get_interface();
  }
}

const controller_t* controller_get_test_interface(
    const hci_t* hci_interface,
    const hci_packet_factory_t* packet_factory_interface,