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

Commit 7af046d2 authored by Chris Manton's avatar Chris Manton
Browse files

gd_shim_acl: Plumb stack/acl/btm_acl::on_acl_br_edr_{success,failed}

Try not to re-converge divergent code paths

Bug: 163134718
Tag: #refactor
Test: compile & verify basic functions working

Change-Id: Ie78d6b8c8d4eca1a24175a07f4e775e92439ce1b
parent ffa22f65
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -957,7 +957,7 @@ void bluetooth::shim::legacy::Acl::OnConnectSuccess(
      ->ReadRemoteControllerInformation();
      ->ReadRemoteControllerInformation();


  TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_connected, bd_addr,
  TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_connected, bd_addr,
                      handle, HCI_SUCCESS, false);
                      handle, false);
  LOG_DEBUG("Connection successful classic remote:%s handle:%hu initiator:%s",
  LOG_DEBUG("Connection successful classic remote:%s handle:%hu initiator:%s",
            PRIVATE_ADDRESS(remote_address), handle,
            PRIVATE_ADDRESS(remote_address), handle,
            (locally_initiated) ? "local" : "remote");
            (locally_initiated) ? "local" : "remote");
@@ -970,7 +970,7 @@ void bluetooth::shim::legacy::Acl::OnConnectFail(hci::Address address,
                                                 hci::ErrorCode reason) {
                                                 hci::ErrorCode reason) {
  const RawAddress bd_addr = ToRawAddress(address);
  const RawAddress bd_addr = ToRawAddress(address);
  TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_failed, bd_addr,
  TRY_POSTING_ON_MAIN(acl_interface_.connection.classic.on_failed, bd_addr,
                      kInvalidHciHandle, ToLegacyHciErrorCode(reason), false);
                      ToLegacyHciErrorCode(reason));
  LOG_WARN("Connection failed classic remote:%s reason:%s",
  LOG_WARN("Connection failed classic remote:%s reason:%s",
           PRIVATE_ADDRESS(address), hci::ErrorCodeText(reason).c_str());
           PRIVATE_ADDRESS(address), hci::ErrorCodeText(reason).c_str());
  BTM_LogHistory(kBtmLogTag, ToRawAddress(address), "Connection failed",
  BTM_LogHistory(kBtmLogTag, ToRawAddress(address), "Connection failed",
+2 −2
Original line number Original line Diff line number Diff line
@@ -28,8 +28,8 @@ const acl_interface_t GetAclInterface() {
      .on_send_data_upwards = acl_rcv_acl_data,
      .on_send_data_upwards = acl_rcv_acl_data,
      .on_packets_completed = acl_packets_completed,
      .on_packets_completed = acl_packets_completed,


      .connection.classic.on_connected = btm_acl_connected,
      .connection.classic.on_connected = on_acl_br_edr_connected,
      .connection.classic.on_failed = btm_acl_connected,
      .connection.classic.on_failed = on_acl_br_edr_failed,
      .connection.classic.on_disconnected = btm_acl_disconnected,
      .connection.classic.on_disconnected = btm_acl_disconnected,


      .connection.le.on_connected =
      .connection.le.on_connected =
+2 −3
Original line number Original line Diff line number Diff line
@@ -29,9 +29,8 @@ namespace legacy {


typedef struct {
typedef struct {
  void (*on_connected)(const RawAddress& bda, uint16_t handle,
  void (*on_connected)(const RawAddress& bda, uint16_t handle,
                       tHCI_STATUS status, uint8_t enc_mode);
  void (*on_failed)(const RawAddress& bda, uint16_t handle, tHCI_STATUS status,
                       uint8_t enc_mode);
                       uint8_t enc_mode);
  void (*on_failed)(const RawAddress& bda, tHCI_STATUS status);
  void (*on_disconnected)(tHCI_STATUS status, uint16_t handle,
  void (*on_disconnected)(tHCI_STATUS status, uint16_t handle,
                          tHCI_STATUS reason);
                          tHCI_STATUS reason);
} acl_classic_connection_interface_t;
} acl_classic_connection_interface_t;
+3 −0
Original line number Original line Diff line number Diff line
@@ -28,6 +28,9 @@
void btm_acl_connection_request(const RawAddress& bda, uint8_t* dc);
void btm_acl_connection_request(const RawAddress& bda, uint8_t* dc);
void btm_acl_connected(const RawAddress& bda, uint16_t handle,
void btm_acl_connected(const RawAddress& bda, uint16_t handle,
                       tHCI_STATUS status, uint8_t enc_mode);
                       tHCI_STATUS status, uint8_t enc_mode);
void on_acl_br_edr_connected(const RawAddress& bda, uint16_t handle,
                             uint8_t enc_mode);
void on_acl_br_edr_failed(const RawAddress& bda, tHCI_STATUS status);
void btm_acl_disconnected(tHCI_STATUS status, uint16_t handle,
void btm_acl_disconnected(tHCI_STATUS status, uint16_t handle,
                          tHCI_STATUS reason);
                          tHCI_STATUS reason);
void btm_acl_encrypt_change(uint16_t handle, uint8_t status,
void btm_acl_encrypt_change(uint16_t handle, uint8_t status,