#include "gd/hci/controller.h"
#include "gd/os/handler.h"
#include "gd/os/queue.h"
+#include "main/shim/btm.h"
#include "main/shim/dumpsys.h"
#include "main/shim/entry.h"
#include "main/shim/helpers.h"
handler->BindOn(this, &Acl::on_incoming_acl_credits));
bluetooth::shim::RegisterDumpsysFunction(static_cast<void*>(this),
[this](int fd) { Dump(fd); });
+ Stack::GetInstance()->GetBtm()->Register_HACK_SetScoDisconnectCallback(
+ [this](uint16_t handle, uint8_t reason) {
+ TRY_POSTING_ON_MAIN(acl_interface_.connection.sco.on_disconnected,
+ handle, static_cast<tHCI_REASON>(reason));
+ });
}
bluetooth::shim::legacy::Acl::~Acl() {
return false;
}
+void bluetooth::shim::legacy::Acl::HACK_OnScoDisconnected(uint16_t handle,
+ uint8_t reason) {
+ TRY_POSTING_ON_MAIN(acl_interface_.connection.sco.on_disconnected, handle,
+ static_cast<tHCI_REASON>(reason));
+}
+
void bluetooth::shim::legacy::Acl::DumpConnectionHistory(int fd) const {
pimpl_->DumpConnectionHistory(fd);
}
uint16_t minimum_remote_timeout,
uint16_t minimum_local_timeout) override;
+ void HACK_OnScoDisconnected(uint16_t handle, uint8_t reason);
+
void WriteData(uint16_t hci_handle,
std::unique_ptr<bluetooth::packet::RawBuilder> packet);
.connection.le.on_failed = acl_ble_connection_fail,
.connection.le.on_disconnected = btm_acl_disconnected,
+ .connection.sco.on_disconnected = nullptr,
+
.link.classic.on_authentication_complete = btm_sec_auth_complete,
.link.classic.on_central_link_key_complete = nullptr,
.link.classic.on_change_connection_link_key_complete = nullptr,
} acl_le_connection_interface_t;
typedef struct {
+ void (*on_disconnected)(uint16_t handle, tHCI_REASON reason);
+} acl_sco_connection_interface_t;
+
+typedef struct {
void (*on_authentication_complete)(uint16_t handle, tHCI_STATUS status);
void (*on_change_connection_link_key_complete)();
void (*on_encryption_change)(bool enabled);
typedef struct {
acl_classic_connection_interface_t classic;
acl_le_connection_interface_t le;
+ acl_sco_connection_interface_t sco;
} acl_connection_interface_t;
typedef struct {