Skip to content

Conversation

@riggs
Copy link

@riggs riggs commented Sep 12, 2017

Slightly different approach to WebUSB than #91 that is more in the style of the rest of LUFA.

Personally, I think it's more readable (and, thus, maintainable) as well, but that just opinion. The tradeoff is a slight memory performance hit (unless someone else wants to figure out which magic combination of pgm_read_byte calls is necessary to deal with memcpy from nested structs in PROGMEM).

I isolated WebUSBDevice.h & BOSDescriptors.h in order to allow them to be baked back into the framework code, though I couldn't figure out how to actually hook them in. Also, there's code in Descriptors.c to generate the return bytes for a BOS request that might make more sense in BOSDescriptors.c (which doesn't exist), but I left it where it is for now because I know that works.

@riggs
Copy link
Author

riggs commented Sep 12, 2017

Some further notes: I based the demo on GenericHID, because that's what the device I migrated to WebUSB was based on. Also, I'm creating an library/extension to WebUSB to allow for easy HID device migration (by adding another platform descriptor & WebUSB descriptor), at which point a GenericHID-based demo is appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant