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

Commit e759dd8d authored by Marvin Younan's avatar Marvin Younan Committed by Gerrit Code Review
Browse files

Merge "Revert "RootCanal: Implement all Role Change configurations""

parents fe05349d 63b5f9b1
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -294,7 +294,6 @@ python_test_host {
        "test/LL/CON_/PER/*.py",
        "test/LL/DDI/ADV/*.py",
        "test/LL/DDI/SCN/*.py",
        "test/LMP/LIH/*.py",
        "test/main.py",
    ],
    data: [
+4 −1
Original line number Diff line number Diff line
@@ -22,8 +22,11 @@ message ControllerQuirks {
  optional bool send_acl_data_before_connection_complete = 1;
  // Configure a default value for the LE random address.
  optional bool has_default_random_address = 2;
  // Send the Role Change event before the Connection Complete event
  // in the case where a role switch is initiated at connection establishment.
  optional bool send_role_change_before_connection_complete = 3;
  // Send an Hardware Error event if any command is called before HCI Reset.
  optional bool hardware_error_before_reset = 3;
  optional bool hardware_error_before_reset = 4;
}

message Controller {
+4 −0
Original line number Diff line number Diff line
@@ -33,6 +33,10 @@ void AclConnection::Encrypt() { encrypted_ = true; };

bool AclConnection::IsEncrypted() const { return encrypted_; };

uint16_t AclConnection::GetLinkPolicySettings() const {
  return link_policy_settings_;
};

void AclConnection::SetLinkPolicySettings(uint16_t settings) {
  link_policy_settings_ = settings;
}
+1 −15
Original line number Diff line number Diff line
@@ -26,12 +26,6 @@ namespace rootcanal {

using ::bluetooth::hci::AddressWithType;

enum AclConnectionState {
  kActiveMode,
  kHoldMode,
  kSniffMode,
};

// Model the connection of a device to the controller.
class AclConnection {
 public:
@@ -50,15 +44,8 @@ class AclConnection {
  void Encrypt();
  bool IsEncrypted() const;

  uint16_t GetLinkPolicySettings() const;
  void SetLinkPolicySettings(uint16_t settings);
  uint16_t GetLinkPolicySettings() const { return link_policy_settings_; }
  bool IsRoleSwitchEnabled() const {
    return (link_policy_settings_ & 0x1) != 0;
  }
  bool IsHoldModeEnabled() const { return (link_policy_settings_ & 0x2) != 0; }
  bool IsSniffModeEnabled() const { return (link_policy_settings_ & 0x4) != 0; }

  AclConnectionState GetMode() const { return state_; }

  bluetooth::hci::Role GetRole() const;
  void SetRole(bluetooth::hci::Role role);
@@ -94,7 +81,6 @@ class AclConnection {
  // State variables
  bool encrypted_{false};
  uint16_t link_policy_settings_{0};
  AclConnectionState state_{kActiveMode};
  bluetooth::hci::Role role_{bluetooth::hci::Role::CENTRAL};
  std::chrono::steady_clock::time_point last_packet_timestamp_;
  std::chrono::steady_clock::duration timeout_;
+1 −0
Original line number Diff line number Diff line
@@ -1880,6 +1880,7 @@ ControllerProperties::ControllerProperties(
          config.quirks().hardware_error_before_reset();
    }
    // TODO(b/270606199): support send_acl_data_before_connection_complete
    // TODO(b/274476773): support send_role_change_before_connection_complete
  }

  if (!CheckSupportedFeatures()) {
Loading