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

Commit b4eee3f8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "RootCanal: Use unique device identifiers" into main am: d5f4e5ec

parents 93dbc81a d5f4e5ec
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ TestEnvironment::TestEnvironment(
  link_socket_server_ = open_server(&async_manager_, link_port);
  link_ble_socket_server_ = open_server(&async_manager_, link_ble_port);
  connector_ = open_connector(&async_manager_);
  test_model_.SetReuseDeviceIds(!disable_address_reuse);
  test_model_.SetReuseDeviceAddresses(!disable_address_reuse);

  // Get a user ID for tasks scheduled within the test environment.
  socket_user_id_ = async_manager_.GetNextUserId();
+1 −7
Original line number Diff line number Diff line
@@ -33,11 +33,6 @@ constexpr uint16_t kLeMaximumDataLength = 64;
constexpr uint16_t kLeMaximumDataTime = 0x148;
constexpr uint8_t kTransmitPowerLevel = -20;

static int next_instance_id() {
  static int instance_counter = 0;
  return instance_counter++;
}

// Device methods.
std::string DualModeController::GetTypeString() const {
  return "Simulated Bluetooth Controller";
@@ -65,8 +60,7 @@ void DualModeController::SendCommandCompleteUnknownOpCodeEvent(
}

DualModeController::DualModeController(ControllerProperties properties)
    : id_(next_instance_id()), properties_(std::move(properties)),
      random_generator_(id_) {
    : properties_(std::move(properties)), random_generator_(id_) {
  Address public_address{};
  ASSERT(Address::FromString("3C:5A:B4:04:05:06", public_address));
  SetAddress(public_address);
+0 −3
Original line number Diff line number Diff line
@@ -50,9 +50,6 @@ using ::bluetooth::hci::CommandView;
// "Hci" to distinguish it as a controller command.
class DualModeController : public Device {
 public:
  // Unique instance identifier.
  const int id_;

  DualModeController(ControllerProperties properties = ControllerProperties());
  DualModeController(DualModeController&&) = delete;
  DualModeController(const DualModeController&) = delete;
+1 −1
Original line number Diff line number Diff line
@@ -1980,7 +1980,7 @@ void LinkLayerController::SetExtendedInquiryResponse(

LinkLayerController::LinkLayerController(const Address& address,
                                         const ControllerProperties& properties,
                                         int id)
                                         uint32_t id)
    : id_(id),
      address_(address),
      properties_(properties),
+2 −2
Original line number Diff line number Diff line
@@ -57,7 +57,7 @@ class LinkLayerController {
  static constexpr size_t kExtendedInquiryResponseSize = 240;

  // Unique instance identifier.
  const int id_;
  const uint32_t id_;

  // Generate a resolvable private address using the specified IRK.
  static Address generate_rpa(
@@ -67,7 +67,7 @@ class LinkLayerController {
  static bool irk_is_zero(std::array<uint8_t, LinkLayerController::kIrkSize> irk);

  LinkLayerController(const Address& address,
                      const ControllerProperties& properties, int id = 0);
                      const ControllerProperties& properties, uint32_t id = 0);
  ~LinkLayerController();

  ErrorCode SendCommandToRemoteByAddress(OpCode opcode, pdl::packet::slice args,
Loading