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

Commit 9b879c82 authored by Myles Watson's avatar Myles Watson
Browse files

Rootcanal: Add SetExtendedProperties

Bug: 138260499
Test: GetExtendedProperties after setting them
Change-Id: Ia507dbda32232b80af6ae698fa9db427de0864fd
parent e9cce272
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -674,6 +674,7 @@ void DualModeController::HciWriteLeHostSupport(packets::PacketView<true> args) {
void DualModeController::HciWriteSecureConnectionHostSupport(
    packets::PacketView<true> args) {
  ASSERT_LOG(args.size() == 1, "%s  size=%zu", __func__, args.size());
  properties_.SetExtendedFeatures(properties_.GetExtendedFeatures(1) | 0x8, 1);
  SendCommandCompleteSuccess(
      bluetooth::hci::OpCode::WRITE_SECURE_CONNECTIONS_HOST_SUPPORT);
}
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ CarKit::CarKit() : Device(kCarKitPropertiesFile) {

  properties_.SetPageScanRepetitionMode(0);
  properties_.SetClassOfDevice(0x600420);
  properties_.SetSupportedFeatures(0x8779ff9bfe8defff);
  properties_.SetExtendedFeatures(0x8779ff9bfe8defff, 0);
  properties_.SetExtendedInquiryData({
      16,  // length
      9,   // Type: Device Name
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ Classic::Classic() {
                                      'g', 'D', 'e', 'v', 'i', 'c', 'e', '-', 'c', 'l', 'a', 's', 's', 'i', 'c',
                                      '\0'});  // End of data
  properties_.SetPageScanRepetitionMode(0);
  properties_.SetSupportedFeatures(0x87593F9bFE8FFEFF);
  properties_.SetExtendedFeatures(0x87593F9bFE8FFEFF, 0);

  page_scan_delay_ms_ = std::chrono::milliseconds(600);
}
+4 −3
Original line number Diff line number Diff line
@@ -49,8 +49,9 @@ class DeviceProperties {
    return extended_features_[0];
  }

  void SetSupportedFeatures(uint64_t features) {
    extended_features_[0] = features;
  void SetExtendedFeatures(uint64_t features, uint8_t page_number) {
    ASSERT(page_number < extended_features_.size());
    extended_features_[page_number] = features;
  }

  // Specification Version 4.2, Volume 2, Part E, Section 7.4.4
@@ -311,7 +312,7 @@ class DeviceProperties {
  std::vector<uint8_t> supported_codecs_;
  std::vector<uint32_t> vendor_specific_codecs_;
  std::vector<uint8_t> supported_commands_;
  std::vector<uint64_t> extended_features_{{0x875b3fd8fe8ffeff, 0x07}};
  std::vector<uint64_t> extended_features_{{0x875b3fd8fe8ffeff, 0x0f}};
  ClassOfDevice class_of_device_{{0, 0, 0}};
  std::vector<uint8_t> extended_inquiry_data_;
  std::vector<uint8_t> name_;