USB : USB Classes    Packing and Unpacking  

Perhaps you have tried doing this yourself.

Maybe you started with that data layout, and then had to write one of those complicated Report Descriptors to match your intended data layout. Or maybe had to figure it out the other way: you were given a Report Descriptor, and had to figure out what the data layout is. Either way, we sure hope you got it right! :-)

Then, on BOTH the PC and the peripheral side, you then have to write code that can pack data into packets with this layout, AND unpack data from such packets as well. Each byte of the packet contains different stuff, so it is sure to be a lot of work.

Now packing and unpacking something like this example (which is only a few bytes long) is something you might tackle yourself. But what if your Report was much larger, requiring you to write code to pack and unpack hundreds of bytes like this, in multiple packets?


7 of 14
Copyright Notice and Author Information