Skip to content

Add HID OUT Report to the Pluggable HID (Keyboard Leds) #3820

Closed
@NicoHood

Description

It would be nice to be able to check the keyboard leds with the pluggable HID. This would also make RAW HID possible as well (receiving from the Host).

Good Resources:
https://github.com/NicoHood/HID/blob/345dc26257238f8d361d1bed4b56d9d2114c4e99/avr/cores/hid/USB-Core/HID.cpp#L152-L166
https://github.com/NicoHood/HID/blob/345dc26257238f8d361d1bed4b56d9d2114c4e99/avr/cores/hid/USB-Core/HID.h#L172-L218
https://github.com/PaulStoffregen/cores/blob/master/teensy3/usb_dev.c#L483-L488

The code above should better use the wIndex value:
https://github.com/abcminiuser/lufa/blob/master/Demos/Device/LowLevel/KeyboardMouse/KeyboardMouse.c#L146-L156

Also see this:
https://github.com/abcminiuser/lufa/blob/master/Demos/Device/LowLevel/GenericHID/GenericHID.c#L148

This needs to be implemented here:
https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/libraries/HID/HID.cpp#L126-L130
https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/cores/arduino/USBAPI.h#L160-L168

https://github.com/abcminiuser/lufa/blob/master/LUFA/Drivers/USB/Class/Device/HIDClassDevice.c#L54

Maybe we could change the pluggable HID this way, that you pass the whole class (this) as pointer and make a function getDescriptor() with the friends attribute, that only the HID class can access it and nothing else? This way we do not need to save pointers for every value (like reportID etc) and also the HIDDescriptor pointer would be not needed anymore. That would require a parent class with virtual functions.
https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/libraries/HID/HID.h#L47-L57

CC @facchinm

Also a quick question:
Why didnt you put extern HID_ HID; inside the HID header, so that the other libraries can include this and do not need to dupe this code? Is it because the user should not accidentally see the HID instance?

Edit: I am currently working on a patch! Updates coming soon!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Component: USB DeviceOpposed to USB Host. Related to the USB subsystem (SerialUSB, HID, ...)Library: HIDThe HID Arduino libraryfeature requestA request to make an enhancement (not a bug fix)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions