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

Commit 878a51c9 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "RootCanal: Implement LEReadBufferV2" am: 46cf369a am: 6e04f209 am: 0d88b868

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1840715

Change-Id: If1b13c6e086edd4176b8c09702436c140654b2dd
parents b39eac8f 0d88b868
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -204,6 +204,7 @@ DualModeController::DualModeController(const std::string& properties_filename, u
  SET_SUPPORTED(REMOTE_NAME_REQUEST, RemoteNameRequest);
  SET_SUPPORTED(LE_SET_EVENT_MASK, LeSetEventMask);
  SET_SUPPORTED(LE_READ_BUFFER_SIZE_V1, LeReadBufferSize);
  SET_SUPPORTED(LE_READ_BUFFER_SIZE_V2, LeReadBufferSizeV2);
  SET_SUPPORTED(LE_READ_LOCAL_SUPPORTED_FEATURES, LeReadLocalSupportedFeatures);
  SET_SUPPORTED(LE_SET_RANDOM_ADDRESS, LeSetRandomAddress);
  SET_SUPPORTED(LE_SET_ADVERTISING_PARAMETERS, LeSetAdvertisingParameters);
@@ -1590,6 +1591,23 @@ void DualModeController::LeReadBufferSize(CommandView command) {
  send_event_(std::move(packet));
}

void DualModeController::LeReadBufferSizeV2(CommandView command) {
  auto command_view = gd_hci::LeReadBufferSizeV2View::Create(command);
  ASSERT(command_view.IsValid());

  bluetooth::hci::LeBufferSize le_buffer_size;
  le_buffer_size.le_data_packet_length_ = properties_.GetLeDataPacketLength();
  le_buffer_size.total_num_le_packets_ = properties_.GetTotalNumLeDataPackets();
  bluetooth::hci::LeBufferSize iso_buffer_size;
  iso_buffer_size.le_data_packet_length_ = properties_.GetIsoDataPacketLength();
  iso_buffer_size.total_num_le_packets_ =
      properties_.GetTotalNumIsoDataPackets();

  auto packet = bluetooth::hci::LeReadBufferSizeV2CompleteBuilder::Create(
      kNumCommandPackets, ErrorCode::SUCCESS, le_buffer_size, iso_buffer_size);
  send_event_(std::move(packet));
}

void DualModeController::LeSetAddressResolutionEnable(CommandView command) {
    // NOP
    auto payload =
+3 −0
Original line number Diff line number Diff line
@@ -531,6 +531,9 @@ class DualModeController : public Device {
  // 7.8.77
  void LeSetPrivacyMode(CommandView args);

  // 7.8.93 (moved to 7.8.2)
  void LeReadBufferSizeV2(CommandView args);

  // 7.8.96 - 7.8.110
  void LeReadIsoTxSync(CommandView packet_view);
  void LeSetCigParameters(CommandView packet_view);
+12 −0
Original line number Diff line number Diff line
@@ -327,6 +327,14 @@ class DeviceProperties {
    return num_le_data_packets_;
  }

  uint16_t GetIsoDataPacketLength() const {
    return iso_data_packet_length_;
  }

  uint8_t GetTotalNumIsoDataPackets() const {
    return num_iso_data_packets_;
  }

  // Specification Version 4.2, Volume 2, Part E, Section 7.8.3
  uint64_t GetLeSupportedFeatures() const {
    return le_supported_features_;
@@ -417,6 +425,10 @@ class DeviceProperties {
  uint8_t le_advertisement_type_{};
  std::vector<uint8_t> le_advertisement_;
  std::vector<uint8_t> le_scan_response_;

  // ISO
  uint16_t iso_data_packet_length_{1021};
  uint8_t num_iso_data_packets_{12};
};

}  // namespace test_vendor_lib