[riot-notifications] [RIOT-OS/RIOT] usbus/hid_io: add missing header file, add RX callback function (#16689)

Nils Ollrogge notifications at github.com
Mon Aug 2 19:26:57 CEST 2021


> > As of now only one callback function can be registered and would be overwritten by a subsequent call to `usb_hid_io_set_rx_cb`. Since it could be the case that multiple applications want to register this callback, a better solution would be to use a linked_list of callback functions.
> > What do you guys think @PeterKietzmann @dylad @bergzand ?
> 
> Can you expand on this? Do you have a use case in mind with two interesting applications? I'm not overly familiar with this, but if the HID device is a mouse wouldn't there be a single controller for all the events, and therefore only the need to register a single callback?
> 
> Wouldn't it make sense for the callback to at least have a void pointer argument?

The use case I thought about was having more than one HID device, while both want to to use `hid_io.c`. However in this case one would also need individual buffers etc. This is something to add in further PR's I think. Therefore 1 static callback function is actually fine for now I think.

Why would you add a void pointer argument ? What would you pass as argument from the USB HID layer ? 




-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/16689#issuecomment-891202161
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20210802/a7386224/attachment-0001.htm>


More information about the notifications mailing list