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

Commit 23f44f31 authored by Henri Chataing's avatar Henri Chataing Committed by Gerrit Code Review
Browse files

Merge "RootCanal: Add strict flag to control FATAL asserts"

parents b4c30ffb 76cda4b5
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -39,6 +39,10 @@ message Controller {
  // Quirks are behaviors observed in real controllers that are not valid
  // according to the specification.
  optional ControllerQuirks quirks = 3;
  // Enable strict mode (defaults to enabled).
  // Activate assertion checks in RootCanal for missing RootCanal features
  // or Host stack misbehavior.
  optional bool strict = 4;
}

message TcpServer {
+2 −1
Original line number Diff line number Diff line
@@ -1818,7 +1818,8 @@ static void SetSupportedCommandBits(std::array<uint8_t, 64>& supported_commands,

ControllerProperties::ControllerProperties(
    rootcanal::configuration::Controller const& config)
    : supported_commands(std::move(SupportedCommands())),
    : strict(!config.has_strict() || config.strict()),
      supported_commands(std::move(SupportedCommands())),
      lmp_features({Page0LmpFeatures(), 0, Page2LmpFeatures()}),
      le_features(LlFeatures()) {
  using namespace rootcanal::configuration;
+3 −0
Original line number Diff line number Diff line
@@ -83,6 +83,9 @@ struct ControllerProperties {
  // Enabled quirks.
  ControllerQuirks quirks{};

  // Strict mode.
  bool strict{true};

  // Local Version Information (Vol 4, Part E § 7.4.1).
  HciVersion hci_version{HciVersion::V_5_3};
  LmpVersion lmp_version{LmpVersion::V_5_3};
+1 −1
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ void DualModeController::HandleCommand(
  }
  // Command is supported but not implemented:
  // the command needs to be implemented to fix this.
  else if (is_supported_command) {
  else if (is_supported_command && properties_.strict) {
    FATAL(id_,
          "Unimplemented command {};\n"
          "This message will be displayed if the command is set as supported\n"