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

Commit 5f116abb authored by Myles Watson's avatar Myles Watson
Browse files

Use tHCI_STATUS from ACL

Bug: 304830775
Test: mma -j32
Change-Id: I82bdc038f11697ec683b185602f0aa218a8afa03
parent 0110997f
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -64,7 +64,6 @@
#include "stack/include/bt_hdr.h"
#include "stack/include/btm_api.h"
#include "stack/include/btm_status.h"
#include "stack/include/gatt_api.h"
#include "stack/include/pan_api.h"
#include "stack/include/sec_hci_link_interface.h"
#include "stack/l2cap/l2c_int.h"
@@ -826,10 +825,9 @@ class LeShimAclConnection

  void OnPhyUpdate(hci::ErrorCode hci_status, uint8_t tx_phy,
                   uint8_t rx_phy) override {
    TRY_POSTING_ON_MAIN(
        interface_.on_phy_update,
        static_cast<tGATT_STATUS>(ToLegacyHciErrorCode(hci_status)), handle_,
        tx_phy, rx_phy);
    TRY_POSTING_ON_MAIN(interface_.on_phy_update,
                        ToLegacyHciErrorCode(hci_status), handle_, tx_phy,
                        rx_phy);
  }

  void OnDisconnection(hci::ErrorCode reason) {
+1 −2
Original line number Diff line number Diff line
@@ -18,12 +18,11 @@

#include "stack/include/acl_hci_link_interface.h"
#include "stack/include/ble_acl_interface.h"
#include "stack/include/gatt_api.h"
#include "stack/include/sco_hci_link_interface.h"
#include "stack/include/sec_hci_link_interface.h"

struct tBTM_ESCO_DATA;
void gatt_notify_phy_updated(tGATT_STATUS status, uint16_t handle,
void gatt_notify_phy_updated(tHCI_STATUS status, uint16_t handle,
                             uint8_t tx_phy, uint8_t rx_phy);
void gatt_notify_subrate_change(uint16_t handle, uint16_t subrate_factor,
                                uint16_t latency, uint16_t cont_num,
+1 −2
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@

#include "stack/include/bt_hdr.h"
#include "stack/include/bt_types.h"
#include "stack/include/gatt_api.h"
#include "stack/include/hci_error_code.h"
#include "stack/include/hci_mode.h"
#include "stack/include/hcidefs.h"
@@ -127,7 +126,7 @@ typedef struct {
  void (*on_read_remote_version_information_complete)(
      tHCI_STATUS status, uint16_t handle, uint8_t lmp_version,
      uint16_t manufacturer_name, uint16_t sub_version);
  void (*on_phy_update)(tGATT_STATUS status, uint16_t handle, uint8_t tx_phy,
  void (*on_phy_update)(tHCI_STATUS status, uint16_t handle, uint8_t tx_phy,
                        uint8_t rx_phy);

  void (*on_le_subrate_change)(uint16_t handle, uint16_t subrate_factor,
+2 −2
Original line number Diff line number Diff line
@@ -51,7 +51,7 @@
void gatt_notify_conn_update(const RawAddress& remote, uint16_t interval,
                             uint16_t latency, uint16_t timeout,
                             tHCI_STATUS status);
void gatt_notify_phy_updated(tGATT_STATUS status, uint16_t handle,
void gatt_notify_phy_updated(tHCI_STATUS status, uint16_t handle,
                             uint8_t tx_phy, uint8_t rx_phy);

void process_ssr_event(tHCI_STATUS status, uint16_t handle, uint16_t max_tx_lat,
@@ -607,7 +607,7 @@ struct LeLinkPropertyListenerShim

  void OnPhyUpdate(hci::AddressWithType remote, uint8_t tx_phy,
                   uint8_t rx_phy) override {
    gatt_notify_phy_updated(GATT_SUCCESS, info_[remote.GetAddress()].handle,
    gatt_notify_phy_updated(HCI_SUCCESS, info_[remote.GetAddress()].handle,
                            tx_phy, rx_phy);
  }

+5 −3
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ extern tBTM_CB btm_cb;

bool btm_ble_init_pseudo_addr(tBTM_SEC_DEV_REC* p_dev_rec,
                              const RawAddress& new_pseudo_addr);
void gatt_notify_phy_updated(tGATT_STATUS status, uint16_t handle,
void gatt_notify_phy_updated(tHCI_STATUS status, uint16_t handle,
                             uint8_t tx_phy, uint8_t rx_phy);

#ifndef PROPERTY_BLE_PRIVACY_ENABLED
@@ -803,14 +803,16 @@ void BTM_BleSetPhy(const RawAddress& bd_addr, uint8_t tx_phys, uint8_t rx_phys,
  if (!controller_get_interface()->supports_ble_2m_phy() &&
      !controller_get_interface()->supports_ble_coded_phy()) {
    LOG_INFO("Local controller unable to support setting of le phy parameters");
    gatt_notify_phy_updated(GATT_REQ_NOT_SUPPORTED, handle, tx_phys, rx_phys);
    gatt_notify_phy_updated(static_cast<tHCI_STATUS>(GATT_REQ_NOT_SUPPORTED),
                            handle, tx_phys, rx_phys);
    return;
  }

  if (!acl_peer_supports_ble_2m_phy(handle) &&
      !acl_peer_supports_ble_coded_phy(handle)) {
    LOG_INFO("Remote device unable to support setting of le phy parameter");
    gatt_notify_phy_updated(GATT_REQ_NOT_SUPPORTED, handle, tx_phys, rx_phys);
    gatt_notify_phy_updated(static_cast<tHCI_STATUS>(GATT_REQ_NOT_SUPPORTED),
                            handle, tx_phys, rx_phys);
    return;
  }

Loading