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

Commit c5203c21 authored by Chris Manton's avatar Chris Manton
Browse files

gd_acl: Add and connect btm_pm_on_mode_change

Bug: 166280067
Tag: #refactor
Test: gd/cert/run --host

Change-Id: I0f811caefcd6d0a50f3e19c17592a40d13256cd7
parent 164f3fd7
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -238,7 +238,9 @@ class ClassicShimAclConnection
  }

  void OnModeChange(hci::Mode current_mode, uint16_t interval) override {
    LOG_INFO("UNIMPLEMENTED");
    TRY_POSTING_ON_MAIN(interface_.on_mode_change,
                        ToLegacyHciErrorCode(hci::ErrorCode::SUCCESS), handle_,
                        ToLegacyHciMode(current_mode), interval);
  }

  void OnQosSetupComplete(hci::ServiceType service_type, uint32_t token_rate,
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ const acl_interface_t GetAclInterface() {
      .link.classic.on_flow_specification_complete = nullptr,
      .link.classic.on_flush_occurred = nullptr,
      .link.classic.on_central_link_key_complete = nullptr,
      .link.classic.on_mode_change = nullptr,
      .link.classic.on_mode_change = btm_pm_on_mode_change,
      .link.classic.on_packet_type_changed = nullptr,
      .link.classic.on_qos_setup_complete = nullptr,
      .link.classic.on_read_afh_channel_map_complete = nullptr,
+3 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <cstdint>
#include "stack/include/bt_types.h"
#include "stack/include/hci_error_code.h"
#include "stack/include/hcidefs.h"
#include "types/ble_address_with_type.h"
#include "types/raw_address.h"

@@ -59,7 +60,8 @@ typedef struct {
                                         uint32_t access_latency);
  void (*on_flush_occurred)();
  void (*on_central_link_key_complete)(uint8_t key_flag);
  void (*on_mode_change)(uint16_t current_mode, uint16_t interval);
  void (*on_mode_change)(tHCI_STATUS status, uint16_t handle,
                         tHCI_MODE current_mode, uint16_t interval);
  void (*on_packet_type_changed)(uint16_t packet_type);
  void (*on_qos_setup_complete)(uint16_t service_type, uint32_t token_rate,
                                uint32_t peak_bandwidth, uint32_t latency,
+6 −0
Original line number Diff line number Diff line
@@ -838,3 +838,9 @@ static const char* mode_to_string(const tBTM_PM_MODE mode) {
      return "UNKNOWN";
  }
}

void btm_pm_on_mode_change(tHCI_STATUS status, uint16_t handle,
                           tHCI_MODE current_mode, uint16_t interval) {
  btm_sco_chk_pend_unpark(status, handle);
  btm_pm_proc_mode_change(status, handle, current_mode, interval);
}
+2 −0
Original line number Diff line number Diff line
@@ -66,3 +66,5 @@ void acl_process_num_completed_pkts(uint8_t* p, uint8_t evt_len);
void acl_packets_completed(uint16_t handle, uint16_t num_packets);
void acl_process_extended_features(uint16_t handle, uint8_t current_page_number,
                                   uint8_t max_page_number, uint64_t features);
void btm_pm_on_mode_change(tHCI_STATUS status, uint16_t handle,
                           tHCI_MODE current_mode, uint16_t interval);