From: Yulong Date: Tue, 25 Apr 2017 12:14:54 +0000 (-0400) Subject: component/bt:Merge the new master to this branch X-Git-Tag: v2.1-rc1~154^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4d9aadeca4e402a38d507f714e13b4de999553a;p=esp-idf component/bt:Merge the new master to this branch --- a4d9aadeca4e402a38d507f714e13b4de999553a diff --cc components/bt/bluedroid/btc/core/btc_task.c index 40a08e44a1,e267f09362..dcecf83c28 --- a/components/bt/bluedroid/btc/core/btc_task.c +++ b/components/bt/bluedroid/btc/core/btc_task.c @@@ -50,10 -47,9 +51,11 @@@ static btc_func_t profile_tab[BTC_PID_N [BTC_PID_GAP_BLE] = {btc_gap_ble_call_handler, btc_gap_ble_cb_handler }, [BTC_PID_BLE_HID] = {NULL, NULL}, [BTC_PID_SPPLIKE] = {NULL, NULL}, +#if (GATTS_INCLUDED == TRUE) [BTC_PID_BLUFI] = {btc_blufi_call_handler, btc_blufi_cb_handler }, +#endif ///GATTS_INCLUDED == TRUE [BTC_PID_DM_SEC] = {NULL, btc_dm_sec_cb_handler }, + [BTC_PID_ALARM] = {btc_alarm_handler, NULL }, #if CONFIG_CLASSIC_BT_ENABLED [BTC_PID_GAP_BT] = {btc_gap_bt_call_handler, NULL }, [BTC_PID_PRF_QUE] = {btc_profile_queue_handler, NULL }, diff --cc examples/bluetooth/gatt_client/main/gattc_demo.c index adbadcfc93,089289d005..89df839360 --- a/examples/bluetooth/gatt_client/main/gattc_demo.c +++ b/examples/bluetooth/gatt_client/main/gattc_demo.c @@@ -317,10 -316,10 +316,9 @@@ static void esp_gap_cb(esp_gap_ble_cb_e for (int j = 0; j < adv_name_len; j++) { ESP_LOGI(GATTC_TAG, "%c", adv_name[j]); } - memcpy(adv_name_char, adv_name, adv_name_len); - if (adv_name != NULL) { - if (strcmp(adv_name_char, device_name) == 0) { - ESP_LOGI(GATTC_TAG, "Searched device %s", device_name); + if (strlen(device_name) == adv_name_len && strncmp((char *)adv_name, device_name, adv_name_len) == 0) { + ESP_LOGI(GATTC_TAG, "Searched device %s\n", device_name); if (connect == false) { connect = true; ESP_LOGI(GATTC_TAG, "Connect to the remote device.");