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

Commit f7f8468c authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "RootCanal: Use supported commands from config file"

parents b222811d 2155d8bc
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -39,6 +39,12 @@ static void ParseUint16t(Json::Value value, uint16_t* field) {
    *field = value.asUInt();
}

static void ParseBool(Json::Value value, bool* field) {
  if (value.isBool()) {
    *field = value.asBool();
  }
}

namespace test_vendor_lib {

DeviceProperties::DeviceProperties(const std::string& file_name)
@@ -101,6 +107,8 @@ DeviceProperties::DeviceProperties(const std::string& file_name)
  ParseUint8t(root["LmpPalVersion"], &lmp_pal_version_);
  ParseUint16t(root["ManufacturerName"], &manufacturer_name_);
  ParseUint16t(root["LmpPalSubversion"], &lmp_pal_subversion_);
  ParseBool(root["use_supported_commands_from_file"],
            &use_supported_commands_from_file_);
}

}  // namespace test_vendor_lib
+4 −1
Original line number Diff line number Diff line
@@ -46,8 +46,10 @@ class DeviceProperties {
  }

  void SetSupportedCommands(const std::array<uint8_t, 64>& commands) {
    if (!use_supported_commands_from_file_) {
      supported_commands_ = commands;
    }
  }

  // Specification Version 4.2, Volume 2, Part E, Section 7.4.3
  uint64_t GetSupportedFeatures() const {
@@ -390,6 +392,7 @@ class DeviceProperties {
  uint8_t encryption_key_size_{10};
  uint16_t voice_setting_{0x0060};
  uint16_t connection_accept_timeout_{0x7d00};
  bool use_supported_commands_from_file_ = false;

  // Low Energy
  uint16_t le_data_packet_length_;