解配对流程
static int remove_bond(const bt_bdaddr_t *bd_addr)
btif_dm_remove_bond(bd_addr)
static void btif_dm_generic_evt(UINT16 event, char* p_param)
void btif_dm_cb_remove_bond(bt_bdaddr_t *bd_addr)
BTA_DmRemoveDevice((UINT8 *)bd_addr->address);-》BTA_DM_API_REMOVE_DEVICE_EVT
bta_dm_remove_device, /* BTA_DM_API_REMOVE_DEVICE_EVT */
btm_remove_acl(p_dev->bd_addr, transport);断开HCI ACL连接,马上执行完其命令执行完成后的处理工作btu_hcif_process_event-》HCI_DISCONNECTION_COMP_EVT
bta_dm_process_remove_device(other_address);上个函数最后
BTA_GATTC_CancelOpen(0, bd_addr, FALSE);
BTM_SecDeleteDevice(bd_addr);
BTA_GATTC_Refresh(bd_addr);
bta_dm_cb.p_sec_cback(BTA_DM_DEV_UNPAIRED_EVT, &sec_event);走到 -》btif_dm_upstreams_cback
这是最后的操作
-------
{
设置绑定类型
btm_set_bond_type_dev(p_data->link_down.bd_addr, BOND_TYPE_UNKNOWN);
从stack中移除hid设备
btif_hh_remove_device(bd_addr);
移除绑定的bonded设备中的加密key信息
btif_storage_remove_bonded_device(&bd_addr);
执行回调,告诉上层解绑成功
bond_state_changed(BT_STATUS_SUCCESS, &bd_addr, BT_BOND_STATE_NONE);
}
HCI ACL断开命令完成后的回调函数
btu_hcif_process_event (UNUSED_ATTR UINT8 controller_id, BT_HDR *p_msg)
case HCI_DISCONNECTION_COMP_EVT:
btu_hcif_disconnection_comp_evt (p);
static void btu_hcif_disconnection_comp_evt (UINT8 *p)
l2c_link_hci_disc_comp (UINT16 handle, UINT8 reason)
l2cu_release_lcb (p_lcb);//l2c断开—>
l2cu_process_fixed_disc_cback //l2cap fixed_reg.pL2CA_FixedConn_Cb = gatt_le_connect_cback,smp_connect_callback依次执行L2CA_RegisterFixedChannel注册的fixed_reg.pL2CA_FixedConn_Cb回调
l2cu_release_ccb->断开ccb
btm_acl_removed//断开->remove l2cap acl index information
btm_sec_disconnected (handle, reason);//SMP断开
ACL断开后,GATT/ATT断开,并调用注册的回调函数
当btm_remove_acl 断开acl连接后l2cap的连接状态发生改变,则引起注册的回调操作
static void gatt_le_connect_cback (UINT16 chan, BD_ADDR bd_addr, BOOLEAN connected,UINT16 reason, tBT_TRANSPORT transport)
gatt_is_bda_in_the_srv_chg_clt_list查找远程服务端列表是否有此设备,这里为在服务端的列表里
btm_sec_is_a_bonded_dev这个要解配对的设备是一个已绑定的设备LTK&SRK已保存
gatt_add_a_bonded_dev_for_srv_chg(bd_addr);加入到client端的绑定列表中,原意是 srv chg client,不解
执行以下几个后就 l2cap的回调执行完毕
** This function cleans up the control
blocks when L2CAP channel
gatt_cleanup_upon_disc(bd_addr, reason, transport);
(*p_reg->app_cb.p_conn_cb)(p_reg->gatt_if, bda, conn_id, FALSE, reason, transport srvc_eng_srvc_eng_connect_cback GATT profile 连接状态改变*
接下来是SMP层的连接状态改变,说明SMP BR 通道断开连接,执行SMP的回调函数smp_connect_callback
android bluetooth stack-unpair
最新推荐文章于 2023-07-10 21:32:57 发布