cancel
Showing results for 
Search instead for 
Did you mean: 

Hungarian notation on USB code

Dimitris Paraskevopoulos
Associate III
Posted on March 04, 2018 at 15:35

If I am not mistaken some variables on the USB code use hungarian notation e.g. bRequest, wValue, wIndex etc.

However there is one prefix that I don't know what it means bmRequest.

Is it something like multiple bits because it is like a bitfield?

Is there a link that explains the conventions used? Are there any other non standard ones that I may not have spotted yet.

Cheers,

Sat

#hungarian #notation #usb #stm32-stm32cube
4 REPLIES 4
Posted on March 04, 2018 at 15:53

My question is coming from this document. I am asking about the prefix not what the variable does.

Posted on March 04, 2018 at 17:15

The notation matches that of USB specification (Microsoft played part in developing it, and Simonyi developed that notation while at Microsoft, the years roughly match), see the dreaded chapter 9. It does not strictly denote type - while b is for byte and w is for [16-bit] word, bm is there for bitmap (an item where individual bits or groups of few bits have ditinct meanings, in the basic document it's usually byte but in class documents there are multiple-byte bitmaps, too), i for index (the only usage I've seen is index to the strings pool, a byte), bcd for binary-coded-decimal (usually version number and it's usually two bytes).

JW

Posted on March 04, 2018 at 16:28

Sorry I miss-interpreted the sentence: 'I don't know what it means bmRequest.'