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

Commit b8f03530 authored by Chris Manton's avatar Chris Manton
Browse files

Use APIs stack/l2cap/l2c_link

acl_get_link_supervisor_timeout
acl_get_disconnect_reason
acl_set_disconnect_reason

Working towards encapsulation of tACL_CONN

Bug: 159815595
Tag: #refactor
Test: compile & verify basic functions working
Change-Id: Id74164d5322c5c5b93b79ad6b3da4ade0319c7d8
parent 9e2adcce
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -188,7 +188,7 @@ void l2c_link_hci_conn_comp(uint8_t status, uint16_t handle,
      btm_acl_created(ci.bd_addr, NULL, NULL, handle, p_lcb->link_role,
                      BT_TRANSPORT_BR_EDR);

    BTM_SetLinkSuperTout(ci.bd_addr, btm_cb.acl_cb_.btm_def_link_super_tout);
    BTM_SetLinkSuperTout(ci.bd_addr, acl_get_link_supervision_timeout());

    /* If dedicated bonding do not process any further */
    if (p_lcb->is_bonding) {
@@ -345,10 +345,11 @@ bool l2c_link_hci_disc_comp(uint16_t handle, uint8_t reason) {
  } else {
    /* There can be a case when we rejected PIN code authentication */
    /* otherwise save a new reason */
    if (btm_cb.acl_cb_.acl_disc_reason != HCI_ERR_HOST_REJECT_SECURITY)
      btm_cb.acl_cb_.acl_disc_reason = reason;
    if (acl_get_disconnect_reason() != HCI_ERR_HOST_REJECT_SECURITY) {
      acl_set_disconnect_reason(reason);
    }

    p_lcb->disc_reason = btm_cb.acl_cb_.acl_disc_reason;
    p_lcb->disc_reason = acl_get_disconnect_reason();

    /* Just in case app decides to try again in the callback context */
    p_lcb->link_state = LST_DISCONNECTING;