keyboardio / KeyboardioHID

A HID library for Arduino
MIT License
34 stars 17 forks source link

reject Get/Set Protocol for non-boot #90

Closed tlyu closed 1 year ago

tlyu commented 1 year ago

On non-boot devices, reject Get/Set Protocol requests, because we don't implement the boot protocol for non-BootKeyboard devices.

tlyu commented 1 year ago

Note that to function correctly on GD32, this depends on the bugfix in keyboardio/ArduinoCore-GD32-Keyboardio#11.

obra commented 1 year ago

What are the potential repercussions of this change? IIRC, what we're doing matches what Arduino does. (And this will also affect AVR devices)

tlyu commented 1 year ago

There might be broken BIOSes or OSes that insist that all keyboards must accept Set Protocol, which is only required for Boot Devices. If we do accept the request, we should reject attempts to set the protocol to Boot Protocol. We won't send a correct Boot Report on the NKRO keyboard interface, and hosts probably don't like it when Get Protocol doesn't return the same value as previously set by a successful Set Protocol request.

In any case, if we accept the Get Protocol request, we should send a valid value, instead of an empty response (which is what we currently do on the NKRO interface, I think). If you like, I can make a smaller change that does only that part.