14 case (
int) Request::GetStatus:
15 return getStatus(transferBuffer, transferBufferLength, transferBufferMaxLength);
16 case (
int) Request::SetInterface:
17 return setInterface(request, transferBufferLength);
18 case (
int) Request::GetInterface:
19 return getInterface(transferBuffer, transferBufferLength, transferBufferMaxLength);
20 case (
int) Request::ClearFeature:
21 return clearFeature(transferBufferLength);
22 case (
int) Request::SetFeature:
23 return setFeature(transferBufferLength);
28 bool Interface::getStatus(
uint8_t * transferBuffer,
uint16_t * transferBufferLength,
uint16_t transferBufferMaxLength) {
29 *transferBufferLength = min(2, transferBufferMaxLength);
30 for (
int i = 0; i<*transferBufferLength; i++) {
31 transferBuffer[i] = 0;
36 bool Interface::getInterface(
uint8_t * transferBuffer,
uint16_t * transferBufferLength,
uint16_t transferBufferMaxLength) {
37 *transferBufferLength = min(1, transferBufferMaxLength);;
38 if (*transferBufferLength > 0) {
44 bool Interface::setInterface(SetupPacket * request,
uint16_t * transferBufferLength) {
48 *transferBufferLength = 0;
52 bool Interface::clearFeature(
uint16_t * transferBufferLength) {
54 *transferBufferLength = 0;
58 bool Interface::setFeature(
uint16_t * transferBufferLength) {
60 *transferBufferLength = 0;
virtual uint8_t getActiveInterfaceAlternative()=0
bool processSetupInRequest(SetupPacket *request, uint8_t *transferBuffer, uint16_t *transferBufferLength, uint16_t transferBufferMaxLength) override
RequestType requestType() const
virtual void setActiveInterfaceAlternative(uint8_t interfaceAlternativeIndex)=0