Description
The PUSBCallbacks struct (in PluggableUSB.h) is defined like so:
typedef struct __attribute__((packed))
{
bool (*setup)(USBSetup& setup, u8 i);
int (*getInterface)(u8* interfaceNum);
int (*getDescriptor)(int8_t t);
int8_t numEndpoints;
int8_t numInterfaces;
uint8_t *endpointType;
} PUSBCallbacks;
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.