[riot-notifications] [RIOT-OS/RIOT] usbus/hid_io: add missing header file, add RX callback function (#16689)
notifications at github.com
Tue Aug 3 08:34:54 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 guess.
> Why would you add a void pointer argument ? What would you pass as argument from the USB HID layer ?
It wouldn't be from the USB HID layer, it would be from the upper layer, you could pass a descriptor, pointer to a structure with whatever state data, just like you do for xtimer callbacks and other. But I do not have a use case in mind.
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the notifications