Liar!

Turns out I’ve gone and made a liar out of myself, by making more API changes in preparation for the 1.5.0 MyUSB release. The final changes have been made to the descriptor and request APIs.

As I indicated previously, I’ve changed the descriptor structures to use the official names by default. The previous names can still be used however (in fact, I still prefer them in the case of the descriptors, thus the demos use the non-standard names) by defining the token USE_NONSTANDARD_DESCRIPTOR_NAMES in the project makefile. That should satisfy both camps, as the programmer now gets a choice over which scheme to use. Of course, the library internals work correctly with either option.

In a similar vein, the USB_UnhandledControlPacket event now uses the official names for the request parameters – bRequest and bmRequestType instead of Request and RequestType. That small change is reflected in the library internals also, as all request variables now use the official names rather than my own. Using the official names for the parameters reduces confusion amongst developers, as now the descriptor and parameter names match up to the official specification with no room for misinterpretation.

One of the pressing reasons for the change to the official names was the GetDescriptor function, which now has parameters for the full wValue and wIndex values rather than separated and renamed values. Many USB class specifications use the GetDescriptor request to return class-specific data, and in these instances the parameter values take on whole new meanings, which the non-standard names did not reflect adequately.

Host projects will also need to update, as they will be using the non-standard names in the configuration descriptor processing. Like with the device projects, the old names can be brought back with the defining of the new USE_NONSTANDARD_DESCRIPTOR_NAMES token.

A cavet; while the descriptor names can be switched back to the non-standard names, the parameters and the host mode request structure element names cannot. That is because I think that the non-standard descriptor names can add value, while the other non-standard names only add confusion.

 

Comments

No comments so far.

Leave a Reply

 
(will not be published)
 
 
Comment