杰理-蓝牙连接状态下清除配对
delete_all_remote_info_flag = 1;
printf("--------断开手机连接--------");
user_send_cmd_prepare(USER_CTRL_DISCONNECTION_HCI, 0, NULL);
static bool delete_all_remote_info_flag = 0;
bool get_delete_all_remote_info_flag(void)
{
return delete_all_remote_info_flag;
}
void set_delete_all_remote_info_flag(bool flag)
{
delete_all_remote_info_flag = flag;
}
case BT_STATUS_FIRST_DISCONNECT:
case BT_STATUS_SECOND_DISCONNECT:
log_info("BT_STATUS_DISCONNECT\n");
if(get_delete_all_remote_info_flag() )
{
printf("-----------清除手机配对-----------");
set_delete_all_remote_info_flag(0);
user_send_cmd_prepare(USER_CTRL_DEL_ALL_REMOTE_INFO, 0, NULL);
if(tws_api_get_tws_state() == TWS_STA_SIBLING_CONNECTED)
{
printf("-----------清除对耳配对-----------");
tws_api_remove_pairs();
}
}
...
...