OSDN Git Service

Clear background conn list entries during BT power off
authorNitin Arora <niarora@codeaurora.org>
Thu, 30 Jan 2014 03:18:39 +0000 (19:18 -0800)
committerAndre Eisenbach <eisenbach@google.com>
Mon, 30 Jun 2014 19:23:10 +0000 (19:23 +0000)
This clears whitelist entries and resets  bgconn device lists

Change-Id: I551791d63fa826071c113abd383540838f6c59b2

bta/dm/bta_dm_act.c
stack/btm/btm_ble_bgconn.c
stack/btm/btm_ble_gap.c
stack/include/btm_ble_api.h

index e65ec20..8012dfe 100644 (file)
@@ -435,6 +435,9 @@ void bta_dm_disable (tBTA_DM_MSG *p_data)
     bta_dm_disable_search_and_disc();
     bta_dm_cb.disabling = TRUE;
 
+#if BLE_INCLUDED == TRUE && BTA_GATT_INCLUDED == TRUE
+    BTM_BleClearBgConnDev();
+#endif
 
     if(BTM_GetNumAclLinks()==0)
     {
index 628a5d0..5d9981e 100644 (file)
@@ -224,6 +224,7 @@ void btm_ble_clear_white_list (void)
 {
     BTM_TRACE_EVENT ("btm_ble_clear_white_list");
     btsnd_hcic_ble_clear_white_list();
+    memset(&btm_cb.ble_ctr_cb.bg_dev_list, 0, (sizeof(tBTM_LE_BG_CONN_DEV)*BTM_BLE_MAX_BG_CONN_DEV_NUM));
 }
 
 /*******************************************************************************
index 496f57e..0a158bf 100644 (file)
@@ -39,6 +39,7 @@
 #include "vendor_ble.h"
 #endif
 #include "gattdefs.h"
+#include "gatt_int.h"
 
 #include "btm_ble_int.h"
 
@@ -703,6 +704,26 @@ BOOLEAN BTM_BleSetBgConnType(tBTM_BLE_CONN_TYPE   bg_conn_type,
 
 /*******************************************************************************
 **
+** Function         BTM_BleClearBgConnDev
+**
+** Description      This function is called to clear the whitelist,
+**                  end any pending whitelist connections,
+*                   and reset the local bg device list.
+**
+** Parameters       void
+**
+** Returns          void
+**
+*******************************************************************************/
+void BTM_BleClearBgConnDev(void)
+{
+    btm_ble_start_auto_conn(FALSE);
+    btm_ble_clear_white_list();
+    gatt_reset_bgdev_list();
+}
+
+/*******************************************************************************
+**
 ** Function         BTM_BleUpdateBgConnDev
 **
 ** Description      This function is called to add or remove a device into/from
index 5f99c33..1554b41 100644 (file)
@@ -771,6 +771,20 @@ BTM_API extern BOOLEAN BTM_BleSetBgConnType(tBTM_BLE_CONN_TYPE   conn_type,
 *******************************************************************************/
 BTM_API extern BOOLEAN BTM_BleUpdateBgConnDev(BOOLEAN add_remove, BD_ADDR   remote_bda);
 
+/*******************************************************************************
+**
+** Function         BTM_BleClearBgConnDev
+**
+** Description      This function is called to clear the whitelist,
+**                  end any pending whitelist connections,
+*                   and reset the local bg device list.
+**
+** Parameters       void
+**
+** Returns          void
+**
+*******************************************************************************/
+BTM_API extern void BTM_BleClearBgConnDev(void);
 
 /********************************************************
 **