mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
component/bt:Added the GATTS_INCLUDED macro to the bta layer
This commit is contained in:
parent
2723504473
commit
67863ec495
@ -287,11 +287,12 @@ static void gattc_profile_b_event_handler(esp_gattc_cb_event_t event, esp_gatt_i
|
||||
static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param)
|
||||
{
|
||||
uint8_t *adv_name = NULL;
|
||||
char adv_name_char[31] = {0};
|
||||
uint8_t adv_name_len = 0;
|
||||
switch (event) {
|
||||
case ESP_GAP_BLE_SCAN_PARAM_SET_COMPLETE_EVT: {
|
||||
//the unit of the duration is second
|
||||
uint32_t duration = 10;
|
||||
uint32_t duration = 30;
|
||||
esp_ble_gap_start_scanning(duration);
|
||||
break;
|
||||
}
|
||||
@ -316,9 +317,9 @@ static void esp_gap_cb(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *par
|
||||
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((char *)adv_name, device_name) == 0) {
|
||||
if (strcmp(adv_name_char, device_name) == 0) {
|
||||
ESP_LOGI(GATTC_TAG, "Searched device %s", device_name);
|
||||
if (connect == false) {
|
||||
connect = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user