PUSBCallbacks - is it necessary to require static functions? (PluggableUSB in 1.6.6) #3874
Labels
Component: Core
Related to the code for the standard Arduino API
Component: USB Device
Opposed to USB Host. Related to the USB subsystem (SerialUSB, HID, ...)
feature request
A request to make an enhancement (not a bug fix)
Library: HID
The HID Arduino library
Milestone
The PUSBCallbacks struct (in PluggableUSB.h) is defined like so:
This requires the methods setup, getInterface, and getDescriptor to all be static. I haven't dug very far past this (the whole point of PluggableUSB is to keep me as far form the inner horrors of USB as possible!) - but is this necessary? Requiring these methods to be static really complicates setting up classes which can manage their own interfaces and endpoints. If you want each instance of a class to have its own interface/endpoint to make Windows see it as a separate device, you need to be using unique information when building the interface descriptor, which generally you want to be doing in getInterface. GetInterface having to be static prevents you from easily correlating a created interface with a specific instance of your class.
The text was updated successfully, but these errors were encountered: