Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
65 <strong>HID</strong> <strong>Sensor</strong> <strong>Usage</strong>s<br />
DF Dynamic Data, Variable, A read/write single bit Boolean read/write Property<br />
Flag Absolute<br />
value<br />
DV Dynamic Data, Variable, A read/write multi-bit Other typed read/write Property<br />
Value Absolute<br />
value<br />
NAry Named Constant, Array, An enumerated value Enumerated-value Data Field or<br />
Array Absolute or Data,<br />
Array, Absolute<br />
Property<br />
Sel Selection N/A One of the selection One of the selections for the enumerated-<br />
choices for a Named<br />
Array<br />
value of a Data Field or Property<br />
Table 15. <strong>HID</strong> <strong>Usage</strong> Types<br />
These <strong>Usage</strong> Types appear in the listed <strong>Sensor</strong> <strong>Usage</strong> Page (see Section 1, above). They give some<br />
information about how the different types of <strong>Usage</strong>s should be employed.<br />
See Also<br />
For more information about <strong>HID</strong> <strong>Usage</strong> Types; please refer to Section 3.4.2, 3.4.3 of the <strong>USB</strong> <strong>HID</strong> <strong>Usage</strong><br />
<strong>Tables</strong> specification (Reference Document [3]).<br />
3.7.2 <strong>HID</strong> Selectors<br />
One particularly interesting <strong>Usage</strong> Type is the Selector (marked as “Sel” in the tables) and its parent, the<br />
Named Array (marked as “NAry” in the tables).<br />
For those familiar with high-level programming languages such as C++, the Named Array is analogous to a<br />
variable with an enumeration type; the Selectors are analogous to the various enumeration constants that<br />
the variable may take on.<br />
One aspect that is unique about <strong>HID</strong> Selectors is that the actual numeric values of the Report Items that are<br />
passed in the <strong>HID</strong> Reports depend upon both the order in which the Selectors are declared, and interaction<br />
with the Logical Minimum and Logical Maximum declarations. Here is an example for the <strong>Sensor</strong> State<br />
<strong>Usage</strong>:<br />
.<br />
.<br />
.<br />
<strong>HID</strong>_LOGICAL_MIN_8(0), // lowest numerical value of this enumeration will be 0<br />
<strong>HID</strong>_LOGICAL_MAX_8(6), // highest numerical value of this enumeration will be 6<br />
<strong>HID</strong>_REPORT_SIZE(8), // Input Report Item will be 8 bits long<br />
<strong>HID</strong>_REPORT_COUNT(1), // and there are 1 of them<br />
<strong>HID</strong>_USAGE_SENSOR_STATE, // NAry – the Current <strong>Sensor</strong> State reported as Data Field in Input Report<br />
<strong>HID</strong>_COLLECTION(Logical),<br />
<strong>HID</strong>_USAGE_SENSOR_STATE_UNKNOWN, // Sel - this will take on value 0<br />
<strong>HID</strong>_USAGE_SENSOR_STATE_READY, // Sel - this will take on value 1<br />
<strong>HID</strong>_USAGE_SENSOR_STATE_NOT_AVAILABLE, // Sel - this will take on value 2<br />
<strong>HID</strong>_USAGE_SENSOR_STATE_NO_DATA, // Sel - this will take on value 3<br />
<strong>HID</strong>_USAGE_SENSOR_STATE_INITIALIZING, // Sel - this will take on value 4<br />
<strong>HID</strong>_USAGE_SENSOR_STATE_ACCESS_DENIED, // Sel - this will take on value 5<br />
<strong>HID</strong>_USAGE_SENSOR_STATE_ERROR, // Sel - this will take on value 6<br />
<strong>HID</strong>_INPUT(Const_Arr_Abs), // Input Item – takes on characteristics previously declared<br />
<strong>HID</strong>_END_COLLECTION,<br />
.<br />
.<br />
.<br />
Note that for maximum interoperability of implementations, the following assumptions and restrictions are<br />
in force for sensors:<br />
The Named Array <strong>Usage</strong> is applied to a Logical Collection.<br />
All the defined Selectors for each Named Array must be declared (don’t omit any);<br />
Always start the Logical Minimum at zero;