Skip to content
Snippets Groups Projects
Commit 2155d8bc authored by Chienyuan's avatar Chienyuan Committed by Chienyuan Huang
Browse files

RootCanal: Use supported commands from config file

Tag: #refactor
Bug: 197316394
Test: gd/cert/run
BYPASS_LONG_LINES_REASON: Bluetooth likes 120 lines

Change-Id: I6eeae94d515335991f0d21850f7d660dc13797ba
parent 3122b935
No related branches found
No related tags found
No related merge requests found
......@@ -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
......@@ -46,7 +46,9 @@ class DeviceProperties {
}
void SetSupportedCommands(const std::array<uint8_t, 64>& commands) {
supported_commands_ = commands;
if (!use_supported_commands_from_file_) {
supported_commands_ = commands;
}
}
// Specification Version 4.2, Volume 2, Part E, Section 7.4.3
......@@ -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_;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment