Code: Select all
case ESP_GAP_BLE_SCAN_RESULT_EVT:
if(param->scan_rst.search_evt == ESP_GAP_SEARCH_INQ_RES_EVT) {
if(!alreadyDiscovered(param->scan_rst.bda)) {
printf("##############################\n");
esp_log_buffer_hex("!!!!", param->scan_rst.ble_adv, 62);
printf("##############################\n");
printf("ESP_GAP_BLE_SCAN_RESULT_EVT\n");
printf("Device found: ADDR=");
for(int i = 0; i < ESP_BD_ADDR_LEN; i++) {
printf("%02X", param->scan_rst.bda[i]);
if(i != ESP_BD_ADDR_LEN -1) printf(":");
}
// try to read the complete name
uint8_t *adv_name = NULL;
uint8_t adv_name_len = 0;
adv_name = esp_ble_resolve_adv_data(param->scan_rst.ble_adv, ESP_BLE_AD_TYPE_NAME_CMPL, &adv_name_len);
if(adv_name) {
printf("\nFULL NAME=");
for(int i = 0; i < adv_name_len; i++) printf("%c", adv_name[i]);
}
printf("\n\n");
addDevice(param->scan_rst.bda);
}
}
Do you know why
Code: Select all
esp_log_buffer_hex("!!!!", param->scan_rst.ble_adv, 62);