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

Commit e92cfd15 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Pass connection parameter to OnLeConnectSuccess" into tm-dev am: 93836b8b am: 5db46fcf

parents b30fe2ee 5db46fcf
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -78,6 +78,9 @@ class LeAclConnection : public AclConnection {
  // Time Range: 100 ms to 32 s
  uint16_t supervision_timeout_;

  Address local_resolvable_private_address_ = Address::kEmpty;
  Address peer_resolvable_private_address_ = Address::kEmpty;

  virtual void RegisterCallbacks(LeConnectionManagementCallbacks* callbacks, os::Handler* handler);
  virtual void Disconnect(DisconnectReason reason);

+9 −0
Original line number Diff line number Diff line
@@ -341,6 +341,9 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
    std::unique_ptr<LeAclConnection> connection(new LeAclConnection(
        std::move(queue), le_acl_connection_interface_, handle, local_address, remote_address, role));
    connection->peer_address_with_type_ = AddressWithType(address, peer_address_type);
    connection->interval_ = conn_interval;
    connection->latency_ = conn_latency;
    connection->supervision_timeout_ = supervision_timeout;
    connections.add(
        handle, remote_address, queue_down_end, handler_, connection->GetEventCallbacks([this](uint16_t handle) {
          this->connections.invalidate(handle);
@@ -426,6 +429,12 @@ struct le_impl : public bluetooth::hci::LeAddressManagerCallback {
    std::unique_ptr<LeAclConnection> connection(new LeAclConnection(
        std::move(queue), le_acl_connection_interface_, handle, local_address, remote_address, role));
    connection->peer_address_with_type_ = AddressWithType(address, peer_address_type);
    connection->interval_ = conn_interval;
    connection->latency_ = conn_latency;
    connection->supervision_timeout_ = supervision_timeout;
    connection->local_resolvable_private_address_ = connection_complete.GetLocalResolvablePrivateAddress();
    connection->peer_resolvable_private_address_ = connection_complete.GetPeerResolvablePrivateAddress();
    connection_complete.GetLocalResolvablePrivateAddress();
    connections.add(
        handle, remote_address, queue_down_end, handler_, connection->GetEventCallbacks([this](uint16_t handle) {
          this->connections.invalidate(handle);
+11 −8
Original line number Diff line number Diff line
@@ -1497,6 +1497,17 @@ void shim::legacy::Acl::OnLeConnectSuccess(
  hci::Role connection_role = connection->GetRole();
  bool locally_initiated = connection->locally_initiated_;

  uint16_t conn_interval = connection->interval_;
  uint16_t conn_latency = connection->latency_;
  uint16_t conn_timeout = connection->supervision_timeout_;

  RawAddress local_rpa =
      ToRawAddress(connection->local_resolvable_private_address_);
  RawAddress peer_rpa =
      ToRawAddress(connection->peer_resolvable_private_address_);
  tBLE_ADDR_TYPE peer_addr_type =
      (tBLE_ADDR_TYPE)connection->peer_address_with_type_.GetAddressType();

  pimpl_->handle_to_le_connection_map_.emplace(
      handle, std::make_unique<LeShimAclConnection>(
                  acl_interface_.on_send_data_upwards,
@@ -1512,14 +1523,6 @@ void shim::legacy::Acl::OnLeConnectSuccess(
  tBLE_BD_ADDR legacy_address_with_type =
      ToLegacyAddressWithType(address_with_type);

  uint16_t conn_interval = 36; /* TODO Default to 45 msec*/
  uint16_t conn_latency = 0;   /* TODO Default to zero events */
  uint16_t conn_timeout = 500; /* TODO Default to 5s */

  RawAddress local_rpa = RawAddress::kEmpty; /* TODO enhanced */
  RawAddress peer_rpa = RawAddress::kEmpty;  /* TODO enhanced */
  tBLE_ADDR_TYPE peer_addr_type = BLE_ADDR_PUBLIC; /* TODO public */

  // Once an le connection has successfully been established
  // the device address is removed from the controller accept list.