[Nut-upsdev] usbhid-ups.h: hid_info_t structure

Arjen de Korte nut+devel at de-korte.org
Thu Aug 2 15:41:15 UTC 2007


I don't understand how the info_len element from the hid_info_t structure
is used in usbhid-ups. It appears to me that the only use of this element
is now to indicate the length of the string:

> float	info_len;	/* if ST_FLAG_STRING: length of the string */

The above is clear, if the element is flagged as a string, the size of
this string is put in this variable, so that we can use this in
dstate_setaux(). But strangely enough, we use a 'float' here and not an
'int'. Why? Do we expect *very* long strings?

>			/* if HU_TYPE_CMD: command value ; multiplier otherwise */

This comment puzzles me. It looks to me that this deals with the dfl
element (and this is just misplaced), since the this is where this flag
ends up when used by the subdrivers, so probably this comment should be on
a different line. But what does this 'multiplier otherwise' mean?

Best regards, Arjen
-- 
Eindhoven - The Netherlands
Key fingerprint - 66 4E 03 2C 9D B5 CB 9B  7A FE 7E C1 EE 88 BC 57




More information about the Nut-upsdev mailing list