HID host with IDF and Arduino
Posted: Mon Jan 03, 2022 4:53 pm
I need to run the esp_hid_host demo in the Arduino environment. I need to add:
to the Arduino sdkconfig.h file (the one that says "DO NOT EDIT" but alas ...) and I add the setup() and loop() where setup simply calls app_main(). The loop() is empty. It is also necessary to add
It compiles and runs to the point where the scan detects a Bluetooth keyboard. Unlike when it runs when built in the IDF environment, it does not go past this point whereas the IDF version goes on to (apparently) pair and the hidh_callback shows the HID data. The Arduino output is simply:
and stops whereas the IDF output (in part) shows:
Any idea where I need to look next or hints are moving forward. I have no code in the Arduino loop().
Thanks for any feedback.
Code: Select all
#define CONFIG_BT_HID_HOST_ENABLED 1
Code: Select all
#include "BLEUUID.h"
Code: Select all
[ 539][I][esp_hid_host_main.ino:83] hid_demo_task(): SCAN...
[ 5656][I][esp_hid_host_main.ino:86] hid_demo_task(): SCAN: 1 results
BT : 21:14:a5:86:81:b8, RSSI: -92, USAGE: GENERIC, COD: PERIPHERAL[KEYBOARD] srv 0x001, , NAME: iClever IC-BK04 Keyboard
Code: Select all
I (7619) ESP_HIDH_DEMO: 21:14:a5:86:81:b8 OPEN:
BDA:21:14:a5:86:81:b8, Status: OK, Connected: YES, Handle: 0, Usage: KEYBOARD
Name: , Manufacturer: , Serial Number:
PID: 0x7021, VID: 0x04e8, VERSION: 0x011b
Report Map Length: 295
CCONTROL INPUT REPORT, ID: 255, Length: 1
CCONTROL INPUT REPORT, ID: 5, Length: 1
GENERIC INPUT REPORT, ID: 4, Length: 1
CCONTROL INPUT REPORT, ID: 3, Length: 7
CCONTROL INPUT REPORT, ID: 2, Length: 3
KEYBOARD OUTPUT BOOT, ID: 1, Length: 1
KEYBOARD OUTPUT REPORT, ID: 1, Length: 1
KEYBOARD INPUT BOOT, ID: 1, Length: 8
KEYBOARD INPUT REPORT, ID: 1, Length: 8
I (7699) ESP_HIDH_DEMO: 21:14:a5:86:81:b8 INPUT: CCONTROL, MAP: 0, ID: 3, Len: 7, Data:
I (7699) ESP_HIDH_DEMO: 64 21 14 a5 86 a0 b9
I (7709) ESP_HIDH_DEMO: 21:14:a5:86:81:b8 INPUT: KEYBOARD, MAP: 0, ID: 1, Len: 8, Data:
I (7709) ESP_HIDH_DEMO: 00 00 09 00 00 28 b5 fb
Thanks for any feedback.