Open jjj19950710 opened 1 year ago
Can you provide a more detailed description of the problem? And how can I reproduce this issue?
esp_hid_host example turn off ble Bluetooth,other unchanged.and run esp_hid_host and esp_hid_device,esp_hid_host run code snippets during scanning:
void hid_demo_task(void *pvParameters)
{
size_t results_len = 0;
esp_hid_scan_result_t *results = NULL;
ESP_LOGI(TAG, "SCAN...");
//start scan for HID devices
esp_hid_scan(SCAN_DURATION_SECONDS, &results_len, &results);
ESP_LOGI(TAG, "SCAN: %u results", results_len);
if (results_len) {
esp_hid_scan_result_t *r = results;
esp_hid_scan_result_t *cr = NULL;
while (r) {
printf(" %s: " ESP_BD_ADDR_STR ", ", (r->transport == ESP_HID_TRANSPORT_BLE) ? "BLE" : "BT ", ESP_BD_ADDR_HEX(r->bda));
printf("RSSI: %d, ", r->rssi);
printf("USAGE: %s, ", esp_hid_usage_str(r->usage));
#if CONFIG_BT_BLE_ENABLED
if (r->transport == ESP_HID_TRANSPORT_BLE) {
cr = r;
printf("APPEARANCE: 0x%04x, ", r->ble.appearance);
printf("ADDR_TYPE: '%s', ", ble_addr_type_str(r->ble.addr_type));
}
#endif /* CONFIG_BT_BLE_ENABLED */
#if CONFIG_BT_HID_HOST_ENABLED
if (r->transport == ESP_HID_TRANSPORT_BT) {
cr = r;
printf("COD: %s[", esp_hid_cod_major_str(r->bt.cod.major));
esp_hid_cod_minor_print(r->bt.cod.minor, stdout);
printf("] srv 0x%03x, ", r->bt.cod.service);
print_uuid(&r->bt.uuid);
printf(", ");
}
#endif /* CONFIG_BT_HID_HOST_ENABLED */
printf("NAME: %s ", r->name ? r->name : ""); //device name is NULL
printf("\n");
r = r->next;
}
if (cr) {
//open the last result
esp_hidh_dev_open(cr->bda, cr->transport, cr->ble.addr_type);
}
//free the results
esp_hid_scan_results_free(results);
}
vTaskDelete(NULL);
}
The scanned bt bluetooth device name is empty.
printf("NAME: %s ", r->name ? r->name : "");
@jjj19950710 , are you using classic bluetooth?
Yes,I used classic bluetooth
Answers checklist.
General issue report
Development Kit: ESP32 IDF version: v5.0.1 example: esp_hid_host esp_hid_device
When I turn off ble Bluetooth, the device name cannot be obtained from the scan results when running esp_hid_host.Can I find the corresponding device name through the scanned MAC address?