Loading system/main/shim/acl.cc +12 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #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" Loading Loading @@ -792,6 +793,11 @@ bluetooth::shim::legacy::Acl::Acl(os::Handler* handler, 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() { Loading Loading @@ -1133,6 +1139,12 @@ bool bluetooth::shim::legacy::Acl::SniffSubrating( 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); } system/main/shim/acl.h +2 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,8 @@ class Acl : public hci::acl_manager::ConnectionCallbacks, 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); Loading system/main/shim/acl_legacy_interface.cc +2 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ const acl_interface_t GetAclInterface() { .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, Loading system/main/shim/acl_legacy_interface.h +5 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,10 @@ typedef struct { tHCI_STATUS reason); } 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)(); Loading Loading @@ -112,6 +116,7 @@ typedef struct { 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 { Loading Loading
system/main/shim/acl.cc +12 −0 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ #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" Loading Loading @@ -792,6 +793,11 @@ bluetooth::shim::legacy::Acl::Acl(os::Handler* handler, 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() { Loading Loading @@ -1133,6 +1139,12 @@ bool bluetooth::shim::legacy::Acl::SniffSubrating( 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); }
system/main/shim/acl.h +2 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,8 @@ class Acl : public hci::acl_manager::ConnectionCallbacks, 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); Loading
system/main/shim/acl_legacy_interface.cc +2 −0 Original line number Diff line number Diff line Loading @@ -37,6 +37,8 @@ const acl_interface_t GetAclInterface() { .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, Loading
system/main/shim/acl_legacy_interface.h +5 −0 Original line number Diff line number Diff line Loading @@ -47,6 +47,10 @@ typedef struct { tHCI_STATUS reason); } 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)(); Loading Loading @@ -112,6 +116,7 @@ typedef struct { 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 { Loading