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

Commit 56e2856b authored by Henri Chataing's avatar Henri Chataing
Browse files

RootCanal: Implement the control command set_device_configuration

This specific commands lets a tester change the configuration
of a connected device at runtime.

This requirement originates from the PTS-bot test runner
version 8.4.1, which requires different, non compatible dongles
for different tests (e.g. LE only v5.4+ for LE audio tests and
Dual v5.0- for A2DP tests).

The alternate solution would be to open multiple HCI ports
for all required configurations, but it does add complexity
to the test configuration whereby set_device_configuration
can be invoked prior to a test execution.

Bug: 282818191
Test: m root-canal && manual
Change-Id: I1d7570223679f9ab432d6681bbcd6c47bb42c03a
parent 9adb37e9
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ struct ControllerProperties {
  ControllerProperties(ControllerProperties&&) = default;
  ~ControllerProperties() = default;

  ControllerProperties& operator=(ControllerProperties const&) = default;

  // Perform a bitwise and operation on the supported commands mask;
  // the default bit setting is either loaded from the configuration
  // file or all 1s.
+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,11 @@ constexpr uint16_t kLeMaximumDataLength = 64;
constexpr uint16_t kLeMaximumDataTime = 0x148;
constexpr uint8_t kTransmitPowerLevel = -20;

void DualModeController::SetProperties(ControllerProperties properties) {
  WARNING(id_, "updating the device properties!");
  properties_ = std::move(properties);
}

// Device methods.
std::string DualModeController::GetTypeString() const {
  return "Simulated Bluetooth Controller";
+3 −0
Original line number Diff line number Diff line
@@ -60,6 +60,9 @@ class DualModeController : public Device {

  DualModeController& operator=(const DualModeController&) = delete;

  // Overwrite the configuration.
  void SetProperties(ControllerProperties properties);

  // Device methods.
  std::string GetTypeString() const override;

+4 −0
Original line number Diff line number Diff line
@@ -40,6 +40,10 @@ bluetooth::hci::Address PhyDevice::GetAddress() const {
  return device_->GetAddress();
}

std::shared_ptr<Device> PhyDevice::GetDevice() const {
  return device_;
}

void PhyDevice::SetAddress(bluetooth::hci::Address address) {
  device_->SetAddress(std::move(address));
}
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ class PhyDevice {
            int8_t tx_power);

  bluetooth::hci::Address GetAddress() const;
  std::shared_ptr<Device> GetDevice() const;
  void SetAddress(bluetooth::hci::Address address);
  std::string ToString();

Loading