extern void l2c_link_role_changed(const RawAddress* bd_addr, uint8_t new_role,
uint8_t hci_status);
-extern void l2cble_conn_comp(uint16_t handle, uint8_t role,
+extern bool l2cble_conn_comp(uint16_t handle, uint8_t role,
const RawAddress& bda, tBLE_ADDR_TYPE type,
uint16_t conn_interval, uint16_t conn_latency,
uint16_t conn_timeout);
-extern void l2cble_conn_comp_from_address_with_type(
+extern bool l2cble_conn_comp_from_address_with_type(
uint16_t handle, uint8_t role, const tBLE_BD_ADDR& address_with_type,
uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout);
/** This function is called when an HCI Connection Complete event is received.
*/
-void l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
+bool l2cble_conn_comp(uint16_t handle, uint8_t role, const RawAddress& bda,
tBLE_ADDR_TYPE type, uint16_t conn_interval,
uint16_t conn_latency, uint16_t conn_timeout) {
// role == HCI_ROLE_MASTER => scanner completed connection
if (!p_lcb) {
btm_sec_disconnect(handle, HCI_ERR_NO_CONNECTION);
LOG_ERROR("Unable to allocate link resource for le acl connection");
- return;
+ return false;
} else {
if (!l2cu_initialize_fixed_ccb(p_lcb, L2CAP_ATT_CID)) {
btm_sec_disconnect(handle, HCI_ERR_NO_CONNECTION);
LOG_ERROR("Unable to allocate channel resource for le acl connection");
- return;
+ return false;
}
}
} else if (role == HCI_ROLE_MASTER && p_lcb->link_state != LST_CONNECTING) {
LOG_ERROR(
"Received le acl connection as role master but not in connecting "
"state");
- return;
+ return false;
}
if (role == HCI_ROLE_MASTER) alarm_cancel(p_lcb->l2c_lcb_timer);
l2cu_process_fixed_chnl_resp(p_lcb);
}
}
+ return true;
}
-void l2cble_conn_comp_from_address_with_type(
+bool l2cble_conn_comp_from_address_with_type(
uint16_t handle, uint8_t role, const tBLE_BD_ADDR& address_with_type,
uint16_t conn_interval, uint16_t conn_latency, uint16_t conn_timeout) {
- l2cble_conn_comp(handle, role, address_with_type.bda, address_with_type.type,
- conn_interval, conn_latency, conn_timeout);
+ return l2cble_conn_comp(handle, role, address_with_type.bda,
+ address_with_type.type, conn_interval, conn_latency,
+ conn_timeout);
}
/*******************************************************************************