external/bluetooth/bluedroid
修訂 | f677f81068640857f791276c472e34b08d08f3e6 (tree) |
---|---|
時間 | 2014-03-11 03:04:56 |
作者 | Matthew Xie <mattx@goog...> |
Commiter | Android (Google) Code Review |
Merge "DO NOT MERGE Bluetooth: Cleanup bt_config.xml during BLE Scan" into klp-dev
@@ -30,6 +30,7 @@ | ||
30 | 30 | #define BTIF_STORAGE_FILL_PROPERTY(p_prop, t, l, p_v) \ |
31 | 31 | (p_prop)->type = t;(p_prop)->len = l; (p_prop)->val = (p_v); |
32 | 32 | |
33 | +#define BTIF_STORAGE_MAX_ALLOWED_REMOTE_DEVICE 512 | |
33 | 34 | |
34 | 35 | /******************************************************************************* |
35 | 36 | ** Functions |
@@ -463,10 +463,31 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) | ||
463 | 463 | case BTIF_GATT_OBSERVE_EVT: |
464 | 464 | { |
465 | 465 | btif_gattc_cb_t *p_btif_cb = (btif_gattc_cb_t*)p_param; |
466 | - if (!btif_gattc_find_bdaddr(p_btif_cb->bd_addr.address)) | |
466 | + uint8_t remote_name_len; | |
467 | + uint8_t *p_eir_remote_name=NULL; | |
468 | + | |
469 | + p_eir_remote_name = BTA_CheckEirData(p_btif_cb->value, | |
470 | + BTM_EIR_COMPLETE_LOCAL_NAME_TYPE, &remote_name_len); | |
471 | + | |
472 | + if(p_eir_remote_name == NULL) | |
467 | 473 | { |
468 | - btif_gattc_add_remote_bdaddr(p_btif_cb->bd_addr.address, p_btif_cb->addr_type); | |
469 | - btif_gattc_update_properties(p_btif_cb); | |
474 | + p_eir_remote_name = BTA_CheckEirData(p_btif_cb->value, | |
475 | + BT_EIR_SHORTENED_LOCAL_NAME_TYPE, &remote_name_len); | |
476 | + } | |
477 | + | |
478 | + if ((p_btif_cb->addr_type != BLE_ADDR_RANDOM) || (p_eir_remote_name)) | |
479 | + { | |
480 | + if (!btif_gattc_find_bdaddr(p_btif_cb->bd_addr.address)) | |
481 | + { | |
482 | + static const char* exclude_filter[] = | |
483 | + {"LinkKey", "LE_KEY_PENC", "LE_KEY_PID", "LE_KEY_PCSRK", "LE_KEY_LENC", "LE_KEY_LCSRK"}; | |
484 | + | |
485 | + btif_gattc_add_remote_bdaddr(p_btif_cb->bd_addr.address, p_btif_cb->addr_type); | |
486 | + btif_gattc_update_properties(p_btif_cb); | |
487 | + btif_config_filter_remove("Remote", exclude_filter, sizeof(exclude_filter)/sizeof(char*), | |
488 | + BTIF_STORAGE_MAX_ALLOWED_REMOTE_DEVICE); | |
489 | + } | |
490 | + | |
470 | 491 | } |
471 | 492 | HAL_CBACK(bt_gatt_callbacks, client->scan_result_cb, |
472 | 493 | &p_btif_cb->bd_addr, p_btif_cb->rssi, p_btif_cb->value); |
@@ -38,7 +38,7 @@ | ||
38 | 38 | #define LOG_TAG "BTIF_STORAGE" |
39 | 39 | |
40 | 40 | #include "btif_api.h" |
41 | - | |
41 | +#include "btif_storage.h" | |
42 | 42 | #include "btif_util.h" |
43 | 43 | #include "bd.h" |
44 | 44 | #include "gki.h" |
@@ -150,7 +150,6 @@ | ||
150 | 150 | #define BTIF_STORAGE_HL_APP_DATA "hl_app_data_" |
151 | 151 | #define BTIF_STORAGE_HL_APP_MDL_DATA "hl_app_mdl_data_" |
152 | 152 | |
153 | -#define BTIF_STORAGE_MAX_ALLOWED_REMOTE_DEVICE 512 | |
154 | 153 | /************************************************************************************ |
155 | 154 | ** Local type definitions |
156 | 155 | ************************************************************************************/ |