BTM_IsAclConnectionUp(remote_bd_addr, BT_TRANSPORT_BR_EDR)) {
APPL_TRACE_DEBUG("%s ACL is not down. Schedule for Dev Removal when ACL closes",
__FUNCTION__);
+ BTM_SecClearSecurityFlags (remote_bd_addr);
for (index = 0; index < bta_dm_cb.device_list.count; index ++) {
if (!bdcmp( bta_dm_cb.device_list.peer_device[index].peer_bdaddr, remote_bd_addr)) {
break;
#include "bta_gattc_int.h"
#include "l2c_api.h"
+#include "l2c_int.h"
#if (defined BTA_HH_LE_INCLUDED && BTA_HH_LE_INCLUDED == TRUE)
#include "bta_hh_int.h"
/* get any queued command to proceed */
else if (p_q_cmd != NULL) {
p_clcb->p_q_cmd = NULL;
-
- bta_gattc_sm_execute(p_clcb, p_q_cmd->hdr.event, p_q_cmd);
+ /* execute pending operation of link block still present */
+ if (l2cu_find_lcb_by_bd_addr(p_clcb->p_srcb->server_bda,
+ BT_TRANSPORT_LE) != NULL) {
+ bta_gattc_sm_execute(p_clcb, p_q_cmd->hdr.event, p_q_cmd);
+ }
/* if the command executed requeued the cmd, we don't
* want to free the underlying buffer that's being
* referenced by p_clcb->p_q_cmd
//data_dispatcher_register_default(hci->event_dispatcher, btu_hci_msg_queue);
hci->set_data_queue(btu_hci_msg_queue);
-#if (defined(BLE_INCLUDED) && (BLE_INCLUDED == TRUE))
- //bte_load_ble_conf(BTE_BLE_STACK_CONF_FILE);
-#endif
-
//Enbale HCI
bte_main_enable();
return TRUE;
}
+/*******************************************************************************
+**
+** Function BTM_SecClearSecurityFlags
+**
+** Description Reset the security flags (mark as not-paired) for a given
+** remove device.
+**
+*******************************************************************************/
+extern void BTM_SecClearSecurityFlags (BD_ADDR bd_addr)
+{
+ tBTM_SEC_DEV_REC *p_dev_rec = btm_find_dev(bd_addr);
+ if (p_dev_rec == NULL)
+ return;
+
+ p_dev_rec->sec_flags = 0;
+ p_dev_rec->sec_state = BTM_SEC_STATE_IDLE;
+ p_dev_rec->sm4 = BTM_SM4_UNKNOWN;
+}
+
+
/*******************************************************************************
**
** Function BTM_SecReadDevName
tGATT_PREPARE_WRITE_RECORD *prepare_record = NULL;
memset(&sr_data, 0, sizeof(tGATTS_DATA));
+ if (len < 2) {
+ GATT_TRACE_ERROR("%s: Prepare write request was invalid - missing offset, sending error response", __func__);
+ gatt_send_error_rsp(p_tcb, GATT_INVALID_PDU, op_code, handle, FALSE);
+ return;
+ }
//get offset from p_data
STREAM_TO_UINT16(offset, p);
len -= 2;
//extern
char *BTM_SecReadDevName (BD_ADDR bd_addr);
+/*******************************************************************************
+**
+** Function BTM_SecClearSecurityFlags
+**
+** Description Reset the security flags (mark as not-paired) for a given
+** remove device.
+**
+*******************************************************************************/
+extern void BTM_SecClearSecurityFlags (BD_ADDR bd_addr);
+
+
/*****************************************************************************
** POWER MANAGEMENT FUNCTIONS
void smp_pairing_cmpl(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
if (p_cb->total_tx_unacked == 0) {
- /* update connection parameter to remote preferred */
- L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, TRUE);
/* process the pairing complete */
smp_proc_pairing_cmpl(p_cb);
}
*******************************************************************************/
void smp_fast_conn_param(tSMP_CB *p_cb, tSMP_INT_DATA *p_data)
{
- /* disable connection parameter update */
+ /* Disable L2CAP connection parameter updates while bonding since
+ some peripherals are not able to revert to fast connection parameters
+ during the start of service discovery. Connection paramter updates
+ get enabled again once service discovery completes. */
L2CA_EnableUpdateBleConnParams(p_cb->pairing_bda, FALSE);
}