Compatibility and HOGP notes
Tested hardware and keyboards
Tested ESP32 boards
- HiLetgo ESP32 NodeMCU development board: Generic
esp32devboard equipped with an ESP32-WROOM-32D module. - M5Stack Core2 For AWS: M5Stack Core2 main control unit paired with the M5GO-Bottom For AWS expansion base.
Tested BLE keyboards
-
THREEPPY MK108: Standard 8-byte HID input report and 2-byte Consumer Control report, JIS layout.

-
BUFFALO BSKBB335SV: Extended 11-byte HID input report and 2-byte Consumer Control report, US layout.

HID over GATT Profile (HOGP) implementation
- Reads the HID Report Map (
0x2A4B) and switches to Report Mode (0x01) so commercial multi-OS keyboards transmit keystrokes and media keys reliably. - Supports standard 8-byte HID reports (up to 6 simultaneous keys), 11-byte extended reports (up to 10 simultaneous keys without a reserved byte), and 2-byte Consumer Control reports (16-bit media and system Usage IDs).
- Normalizes Resolvable Private Address (RPA) types for reliable automatic reconnection after a reboot or keyboard sleep.
BleKbdHost implements a BLE HOGP Report Host conforming to Bluetooth SIG specifications:
| GATT service or characteristic | UUID | Role in BleKbdHost |
|---|---|---|
| GAP Service / Device Name | 0x1800 / 0x2A00 |
Fallback name resolution when the scan response omits the device name (cached in NVS). |
| HID Service | 0x1812 |
Required service filter during PairingScan and pre-encryption verification. |
| Report Map | 0x2A4B |
The host reads this descriptor during connection setup because many commercial keyboards won't send notifications until it's read. |
| Protocol Mode | 0x2A4E |
The host writes 0x01 (Report Mode) to activate multimedia Consumer Control reports and extended rollover reports. |
| Report | 0x2A4D |
Subscribes to all Notify-capable 0x2A4D characteristics, covering both standard keyboard and Consumer Control endpoints. |
| Boot Keyboard Input | 0x2A22 |
Automatic fallback when a peripheral exposes no Notify-capable 0x2A4D characteristics. |
| Boot Keyboard Output | 0x2A32 |
sendLedReport() writes to this characteristic to control NumLock, CapsLock, and ScrollLock LEDs. |
Supported HID report formats
BleKbdHost detects incoming packet formats automatically by payload length:
- 8-byte standard keyboard report (
len == 8orlen >= 8default)[Modifier, Reserved, Key1, Key2, Key3, Key4, Key5, Key6](6-key rollover) - 11-byte extended keyboard report (
len == 11)[Modifier, Key1, Key2, Key3, Key4, Key5, Key6, Key7, Key8, Key9, Key10](10-key rollover without a reserved byte, which keyboards such as Buffalo use) - 2-byte Consumer Control report (
len == 2)[UsageLSB, UsageMSB](little-endian 16-bit Usage ID from HID Usage Page0x0C)
Multi-OS keyboard mode tips
Many compact Bluetooth keyboards provide host OS mode shortcuts (such as Fn + Q, Fn + W, and Fn + E for Android, Windows, and iOS):
- Use Windows mode for JIS keyboards: On multi-OS JIS keyboards (such as THREEPPY models), switch the keyboard to Windows mode to get standard JIS HID keycodes (
0x35Hankaku/Zenkaku,0x8AHenkan,0x8BMuhenkan) and predictable Shift symbol mappings. iOS and Mac modes often remap modifiers and treat the keyboard as ANSI or Apple JIS.
Known limitations
- No Passkey Entry pairing:
Keyboards that require 6-digit numeric passkey entry during BLE pairing (such as the Logitech Pebble Keys 2 K380s) fail authentication with
Error::AuthFailed. Only keyboards that support Just Works pairing (BLE_HS_IO_NO_INPUT_OUTPUT) work with this library. - Composite reports with leading Report IDs (such as 9-byte packets):
The parser doesn't support combo devices (such as keyboards with built-in touchpads or dual 2.4 GHz and BLE keyboards) that prepend a 1-byte Report ID inside the GATT notification payload (
[ReportID, Modifier, Reserved, Key1..Key6]). - Bitmask consumer reports:
The library expects Consumer Control reports as 2-byte 16-bit Usage IDs. Keyboards that encode media keys as a fixed 1-byte or multi-byte bitfield don't trigger
SpecialKeymedia events. - Bluetooth Classic (BR/EDR) keyboards:
Older Bluetooth 2.0/3.0 keyboards use the Classic HID profile rather than BLE HOGP (
0x1812) and won't appear duringPairingScan. - Single active connection:
Multiple keyboards can be bonded in flash, and
WaitingReconnectconnects to whichever saved keyboard wakes first, but only one keyboard can remain actively connected at a time.
Inspect unsupported keyboards
If a keyboard connects (State::Connected) but certain keys don't register, attach a raw report callback (or flash examples/M5Core2_KeyInspector) to inspect the exact bytes transmitted:
keyboard.setRawReportCallback([](uint16_t handle, const uint8_t* data, size_t len) {
Serial.printf("[RAW] handle=0x%04X len=%2u data:", handle, (unsigned)len);
for (size_t i = 0; i < len; i++) {
Serial.printf(" %02X", data[i]);
}
Serial.println();
});