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

Commit af556017 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Add stack/acl/btm_acl::hci_btm_set_link_supervision_timeout am: d06e1bd2

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1546395

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I784d79af1712503ce14dc9862e064585332aa58b
parents d2910338 d06e1bd2
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -188,6 +188,21 @@ void StackAclBtmAcl::hci_start_role_switch_to_central(tACL_CONN& p_acl) {
  p_acl.rs_disc_pending = BTM_SEC_RS_PENDING;
}

void hci_btm_set_link_supervision_timeout(tACL_CONN& link, uint16_t timeout) {
  if (link.link_role != HCI_ROLE_CENTRAL) {
    /* Only send if current role is Central; 2.0 spec requires this */
    LOG_WARN("Can only set link supervision timeout if central role:%s",
             RoleText(link.link_role).c_str());
    return;
  }

  LOG_DEBUG("Setting link supervision timeout:%.2fs peer:%s",
            double(timeout) * 0.01, PRIVATE_ADDRESS(link.RemoteAddress()));
  link.link_super_tout = timeout;
  btsnd_hcic_write_link_super_tout(LOCAL_BR_EDR_CONTROLLER_ID, link.Handle(),
                                   timeout);
}

/* 3 seconds timeout waiting for responses */
#define BTM_DEV_REPLY_TIMEOUT_MS (3 * 1000)