Skip to content

Add parseConfigEntry to IUSBEnumerator, call from parseConfDescr() #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/USBHost/IUSBEnumerator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class IUSBEnumerator
virtual void setVidPid(uint16_t vid, uint16_t pid) = 0;
virtual bool parseInterface(uint8_t intf_nb, uint8_t intf_class, uint8_t intf_subclass, uint8_t intf_protocol) = 0; //Must return true if the interface should be parsed
virtual bool useEndpoint(uint8_t intf_nb, ENDPOINT_TYPE type, ENDPOINT_DIRECTION dir) = 0; //Must return true if the endpoint will be used
virtual void parseConfigEntry(uint8_t type, uint8_t sub_type, uint8_t *data, uint32_t len) {};
};

#endif /*IUSBENUMERATOR_H_*/
Expand Down
2 changes: 2 additions & 0 deletions src/USBHost/USBHost.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1066,6 +1066,8 @@ void USBHost::parseConfDescr(USBDeviceConnected * dev, uint8_t * conf_descr, uin
lenReportDescr = conf_descr[index + 7] | (conf_descr[index + 8] << 8);
break;
default:
if(parsing_intf)
pEnumerator->parseConfigEntry(id, conf_descr[index+2], &conf_descr[index+3], len_desc-3);
break;
}
index += len_desc;
Expand Down