前置条件:
使用ESP32_DevKitc_V4demo板 + examples\bluetooth\esp_hid_host用例,蓝牙模式设置为:ESP_BT_MODE_BTDM条件下
问题:
无法收索到任何蓝牙设备,而此时用手机是可以收索到蓝牙其他设备的
打印日志如下:
I (613) BTDM_INIT: BT controller compile version [1342a48]
I (623) system_api: Base MAC address is not set
I (623) system_api: read default base MAC address from EFUSE
E (633) system_api: MAC:7c-87-ce-d0-b5-88
E (633) system_api: ESP_MAC_BT type
E (643) system_api: MAC:7c-87-ce-d0-b5-8a
I (653) phy_init: phy_version 4670,719f9f6,Feb 18 2021,17:07:07
I (653) phy_init: phy_version esp_phy_load_cal_and_init:565
I (663) phy_init: phy_version esp_phy_load_cal_and_init:581
I (663) phy_init: phy_version esp_phy_load_cal_and_init:596
I (673) phy_init: phy_version esp_phy_load_cal_and_init:598
I (783) phy_init: phy_version esp_phy_load_cal_and_init:629
E (1373) ESP_HID_GAP: init_bt_gap
E (1383) ESP_HID_GAP: init_ble_gap
W (1383) BT_LOG: esp_ble_gattc_register_callback
E (1383) ESP_HIDH: esp_hidh_init into
E (1393) BLE_HIDH: esp_hidh_gattc_event_handler, event 0x0
E (1393) ESP_HIDH: esp_hidh_init end, ret:0
I (1393) ESP_HIDH_DEMO: SCAN...
E (1403) ESP_HID_GAP: esp_hid_scan0
E (6423) ESP_HID_GAP: esp_hid_scan: bt_ret:0, ble_ret:0
I (6423) ESP_HIDH_DEMO: SCAN: 0 results
ESP32_DevKitc_V4 demo板做蓝牙主机扫描不到任何设备
Re: ESP32_DevKitc_V4 demo板做蓝牙主机扫描不到任何设备
应该搜索到的广播不符合条件给过滤掉了,在BLE 的扫描结果里有解析广播中是否有HID 的服务,处理函数在main/esp_hid_gap.c 中的 handle_ble_device_result() 函数中,BT 应该也有相似的过滤
Who is online
Users browsing this forum: No registered users and 76 guests