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

Commit 6844fc85 authored by Chienyuan's avatar Chienyuan
Browse files

GD HCI: Add unittest for AclConnection

Bug: 139700781
Test: run bluetooth_test_gd
Change-Id: I4bef1ad26b2cd4bc81e572b513852d94a8898899
parent 28d7978e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -360,7 +360,6 @@ struct AclManager::impl {
    auto& acl_connection = acl_connections_.find(handle)->second;
    if (acl_connection.command_complete_handler_ != nullptr) {
      uint16_t packet_type = packet_type_changed.GetPacketType();
      ;
      acl_connection.command_complete_handler_->Post(
          common::BindOnce(&ConnectionManagementCallbacks::OnConnectionPacketTypeChanged,
                           common::Unretained(acl_connection.command_complete_callbacks_), packet_type));
@@ -442,9 +441,10 @@ struct AclManager::impl {
    uint16_t handle = complete_view.GetConnectionHandle();
    auto& acl_connection = acl_connections_.find(handle)->second;
    if (acl_connection.command_complete_handler_ != nullptr) {
      uint16_t clock_offset = complete_view.GetClockOffset();
      acl_connection.command_complete_handler_->Post(
          common::BindOnce(&ConnectionManagementCallbacks::OnReadClockOffsetComplete,
                           common::Unretained(acl_connection.command_complete_callbacks_)));
                           common::Unretained(acl_connection.command_complete_callbacks_), clock_offset));
    }
  }

@@ -1470,7 +1470,7 @@ bool AclConnection::FlowSpecification(FlowDirection flow_direction, ServiceType

bool AclConnection::SniffSubrating(uint16_t maximum_latency, uint16_t minimum_remote_timeout,
                                   uint16_t minimum_local_timeout) {
  return manager_->pimpl_->SniffSubrating(handle_, maximum_latency, maximum_latency, minimum_local_timeout);
  return manager_->pimpl_->SniffSubrating(handle_, maximum_latency, minimum_remote_timeout, minimum_local_timeout);
}

bool AclConnection::Flush() {
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ class ConnectionManagementCallbacks {
  // Invoked when controller sends Change Connection Link Key Complete event with Success error code
  virtual void OnChangeConnectionLinkKeyComplete() = 0;
  // Invoked when controller sends Read Clock Offset Complete event with Success error code
  virtual void OnReadClockOffsetComplete() = 0;
  virtual void OnReadClockOffsetComplete(uint16_t clock_offset) = 0;
  // Invoked when controller sends Mode Change event with Success error code
  virtual void OnModeChange(Mode current_mode, uint16_t interval) = 0;
  // Invoked when controller sends QoS Setup Complete event with Success error code
+391 −0

File changed.

Preview size limit exceeded, changes collapsed.

+2 −2
Original line number Diff line number Diff line
@@ -286,8 +286,8 @@ class AclManagerFacadeService : public AclManagerFacade::Service,
    LOG_DEBUG("OnChangeConnectionLinkKeyComplete");
  };

  void OnReadClockOffsetComplete() override {
    LOG_DEBUG("OnReadClockOffsetComplete");
  void OnReadClockOffsetComplete(uint16_t clock_offset) override {
    LOG_DEBUG("OnReadClockOffsetComplete clock_offset:%d", clock_offset);
  };

  void OnModeChange(Mode current_mode, uint16_t interval) override {