ricardoquesada / bluepad32

Bluetooth gamepad, mouse and keyboard support for ESP32 and PicoW
https://bluepad32.readthedocs.io/
Other
550 stars 57 forks source link

CAPS lock LED Report #116

Open peterburk opened 3 weeks ago

peterburk commented 3 weeks ago

Is your feature request related to a problem? Please describe. I'm very pleased with the bluepad32 examples, and successfully used it on a RPi Pico W to make a Bluetooth - USB HID keyboard bridge this weekend! However, the CAPS lock LED doesn't come on.

Describe the solution you'd like Update the uni_bt_service.gatt to include ORG_BLUETOOTH_CHARACTERISTIC_REPORT_MAP as seen in the btstack example hog_keyboard_demo.c.

Describe alternatives you've considered I've looked into patching uni_bt_service myself, but would prefer for this change to be made upstream so it can benefit more users.

Additional context I'm using an Apple Magic Keyboard (which doesn't work with the HID remapper project, but does work with bluepad32!).

ricardoquesada commented 3 weeks ago

if you could share the code that you did, I can make the needed changes (if needed) and apply them. ty

peterburk commented 2 weeks ago

I see that there's already uni_hid_parser_keyboard_set_leds in uni_hid_parser_keyboard.c - thank you for implementing that! That's much cleaner than my hacks to uni_bt_service.

Unfortunately I haven't got it to work, due to the error "Keyboard: Set LED report not implemented for BR/EDR yet".

I always get status = ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER 0x02.

When I try to create a new connection using hid_host_create_connection, it still fails due to !connection->control_cid.

Is there any plan to implement LED reports for BR/EDR (Classic Bluetooth)?

ricardoquesada commented 2 weeks ago

Correct, for BR/EDR keyboards I'd need to know which report Id I should should... perhaps report Id 1 should work, I can give it a try