Code: Select all
esp_log_buffer_hex("EDDYSTONE_DEMO: Device address:", scan_result->scan_rst.bda, ESP_BD_ADDR_LEN);
this function doesnt works for me,
Code: Select all
esp_bt_dev_get_address(void)
thanks a lot for reading
Code: Select all
esp_log_buffer_hex("EDDYSTONE_DEMO: Device address:", scan_result->scan_rst.bda, ESP_BD_ADDR_LEN);
Code: Select all
esp_bt_dev_get_address(void)
Code: Select all
uint8_t adv_data_len = scan_result->scan_rst.adv_data_len;
uint8_t *adv_data = scan_result->scan_rst.ble_adv;
for(int i = 0; i < ESP_BD_ADDR_LEN; ++i){
printf("%02X ", adv_addr[i]);
}
Code: Select all
uint8_t *adv_addr = scan_result->scan_rst.bda;
for(int i = 0; i < ESP_BD_ADDR_LEN; ++i){ //ESP_BD_ADDR_LEN = 6 and given by example ble_eddystone
printf("%02X ", adv_addr[i]);
}
Code: Select all
//esp_eddystone_demo.c
case ESP_GAP_SEARCH_INQ_RES_EVT: {
esp_eddystone_result_t eddystone_res;
memset(&eddystone_res, 0, sizeof(eddystone_res));
esp_err_t ret = esp_eddystone_decode(scan_result->scan_rst.ble_adv, scan_result->scan_rst.adv_data_len, &eddystone_res);
if (ret) {
// error:The received data is not an eddystone frame packet or a correct eddystone frame packet.
// just return
return;
} else {
// The received adv data is a correct eddystone frame packet.
// Here, we get the eddystone infomation in eddystone_res, we can use the data in res to do other things.
// For example, just print them:
ESP_LOGI(TAG, "--------Eddystone Found----------");
//esp_log_buffer_hex("EDDYSTONE_DEMO: Device address", scan_result->scan_rst.bda, ESP_BD_ADDR_LEN);
uint8_t adv_data_len = scan_result->scan_rst.adv_data_len;
uint8_t *adv_data = scan_result->scan_rst.ble_adv;
for(int i = 0; i < adv_data_len; ++i){
printf("%02X ", adv_data[i]);
}
uint8_t *adv_addr = scan_result->scan_rst.bda;
for(int i = 0; i < ESP_BD_ADDR_LEN; ++i){
printf("%02X ", adv_addr[i]);
}
ESP_LOGI(TAG, "RSSI of packet:%d dbm", scan_result->scan_rst.rssi);
esp_eddystone_show_inform(&eddystone_res);
}
break;
}
yemred wrote: ↑Fri Dec 03, 2021 6:01 ami wanna ansver my own question instead of admins (:
if you wanna get all advertised data in hex combination then code is this
if you wanna get advertiser device address then code is thisCode: Select all
uint8_t adv_data_len = scan_result->scan_rst.adv_data_len; uint8_t *adv_data = scan_result->scan_rst.ble_adv; for(int i = 0; i < ESP_BD_ADDR_LEN; ++i){ printf("%02X ", adv_addr[i]); }
all code where to placed is thisCode: Select all
uint8_t *adv_addr = scan_result->scan_rst.bda; for(int i = 0; i < ESP_BD_ADDR_LEN; ++i){ //ESP_BD_ADDR_LEN = 6 and given by example ble_eddystone printf("%02X ", adv_addr[i]); }
i love you all who read my post.Code: Select all
//esp_eddystone_demo.c case ESP_GAP_SEARCH_INQ_RES_EVT: { esp_eddystone_result_t eddystone_res; memset(&eddystone_res, 0, sizeof(eddystone_res)); esp_err_t ret = esp_eddystone_decode(scan_result->scan_rst.ble_adv, scan_result->scan_rst.adv_data_len, &eddystone_res); if (ret) { // error:The received data is not an eddystone frame packet or a correct eddystone frame packet. // just return return; } else { // The received adv data is a correct eddystone frame packet. // Here, we get the eddystone infomation in eddystone_res, we can use the data in res to do other things. // For example, just print them: ESP_LOGI(TAG, "--------Eddystone Found----------"); //esp_log_buffer_hex("EDDYSTONE_DEMO: Device address", scan_result->scan_rst.bda, ESP_BD_ADDR_LEN); uint8_t adv_data_len = scan_result->scan_rst.adv_data_len; uint8_t *adv_data = scan_result->scan_rst.ble_adv; for(int i = 0; i < adv_data_len; ++i){ printf("%02X ", adv_data[i]); } uint8_t *adv_addr = scan_result->scan_rst.bda; for(int i = 0; i < ESP_BD_ADDR_LEN; ++i){ printf("%02X ", adv_addr[i]); } ESP_LOGI(TAG, "RSSI of packet:%d dbm", scan_result->scan_rst.rssi); esp_eddystone_show_inform(&eddystone_res); } break; }
Users browsing this forum: No registered users and 70 guests