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

Commit 2bbdd744 authored by Myles Watson's avatar Myles Watson Committed by Gerrit Code Review
Browse files

Merge "HciLayer: cpplint fixes" into main

parents 9f5aeb0d ba2a09a2
Loading
Loading
Loading
Loading
+8 −8
Original line number Diff line number Diff line
@@ -41,13 +41,13 @@ public:
  HciInterface() = default;
  virtual ~HciInterface() = default;

  virtual void EnqueueCommand(
  void EnqueueCommand(
          std::unique_ptr<CommandBuilder> command,
          common::ContextualOnceCallback<void(CommandCompleteView)> on_complete) override = 0;

  virtual void EnqueueCommand(
          std::unique_ptr<CommandBuilder> command,
          common::ContextualOnceCallback<void(CommandStatusView)> on_status) override = 0;
  void EnqueueCommand(std::unique_ptr<CommandBuilder> command,
                      common::ContextualOnceCallback<void(CommandStatusView)> on_status) override =
          0;

  virtual common::BidiQueueEnd<AclBuilder, AclView>* GetAclQueueEnd() = 0;

@@ -116,21 +116,21 @@ protected:
  template <typename T>
  class CommandInterfaceImpl : public CommandInterface<T> {
  public:
    explicit CommandInterfaceImpl(HciInterface& hci) : hci_(hci) {}
    explicit CommandInterfaceImpl(HciInterface* hci) : hci_(hci) {}
    virtual ~CommandInterfaceImpl() = default;

    void EnqueueCommand(
            std::unique_ptr<T> command,
            common::ContextualOnceCallback<void(CommandCompleteView)> on_complete) override {
      hci_.EnqueueCommand(std::move(command), std::move(on_complete));
      hci_->EnqueueCommand(std::move(command), std::move(on_complete));
    }

    void EnqueueCommand(
            std::unique_ptr<T> command,
            common::ContextualOnceCallback<void(CommandStatusView)> on_status) override {
      hci_.EnqueueCommand(std::move(command), std::move(on_status));
      hci_->EnqueueCommand(std::move(command), std::move(on_status));
    }
    HciInterface& hci_;
    HciInterface* hci_;
  };
};

+10 −10
Original line number Diff line number Diff line
@@ -21,11 +21,11 @@
#include <memory>
#include <string>

#include "address.h"
#include "class_of_device.h"
#include "common/bidi_queue.h"
#include "common/contextual_callback.h"
#include "hci/acl_connection_interface.h"
#include "hci/address.h"
#include "hci/class_of_device.h"
#include "hci/distance_measurement_interface.h"
#include "hci/hci_interface.h"
#include "hci/hci_packets.h"
@@ -161,14 +161,14 @@ private:
          on_sco_connection_request_{};

  // Interfaces
  CommandInterfaceImpl<AclCommandBuilder> acl_connection_manager_interface_{*this};
  CommandInterfaceImpl<AclCommandBuilder> le_acl_connection_manager_interface_{*this};
  CommandInterfaceImpl<SecurityCommandBuilder> security_interface{*this};
  CommandInterfaceImpl<LeSecurityCommandBuilder> le_security_interface{*this};
  CommandInterfaceImpl<LeAdvertisingCommandBuilder> le_advertising_interface{*this};
  CommandInterfaceImpl<LeScanningCommandBuilder> le_scanning_interface{*this};
  CommandInterfaceImpl<LeIsoCommandBuilder> le_iso_interface{*this};
  CommandInterfaceImpl<DistanceMeasurementCommandBuilder> distance_measurement_interface{*this};
  CommandInterfaceImpl<AclCommandBuilder> acl_connection_manager_interface_{this};
  CommandInterfaceImpl<AclCommandBuilder> le_acl_connection_manager_interface_{this};
  CommandInterfaceImpl<SecurityCommandBuilder> security_interface{this};
  CommandInterfaceImpl<LeSecurityCommandBuilder> le_security_interface{this};
  CommandInterfaceImpl<LeAdvertisingCommandBuilder> le_advertising_interface{this};
  CommandInterfaceImpl<LeScanningCommandBuilder> le_scanning_interface{this};
  CommandInterfaceImpl<LeIsoCommandBuilder> le_iso_interface{this};
  CommandInterfaceImpl<DistanceMeasurementCommandBuilder> distance_measurement_interface{this};
};
}  // namespace hci
}  // namespace bluetooth