70 <strong>HID</strong> <strong>Sensor</strong> <strong>Usage</strong>s Figure 8. The preferred 3D coordinate system used by airplanes is “NED” It is possible to translate between the “ESD” and the “NED” (or any other) coordinate system by using matrix arithmetic, for example: Figure 9. Rotation Matrix translation from "ESD" to "NED"
71 <strong>HID</strong> <strong>Sensor</strong> <strong>Usage</strong>s 4. Illustrative Examples This section is Informative, meaning that they provide unofficial guidelines for how to use the <strong>Usage</strong>s in Section 1, above. It is offered to resolve potential ambiguities and to foster compatibility between separate implementations from multiple vendors. Section 4.1 provides a sample “C” language “include file” which can be used by application developers. Section 4.2 provides descriptions of some special constructions such as: Modifiers, Thresholds, Custom <strong>Sensor</strong>s, and Generic <strong>Sensor</strong>s. Section 4.3 provides illustrative examples of <strong>HID</strong> Report Descriptors for various common sensor types. All of these examples employ use of the “include file” described in Section 4.1. Some of them employ use of the special constructions described in Section 4.2. 4.1 Include File Definitions These definitions are used in common by all report descriptors in these Appendices. These #defines are intended to be compiled by an ANSI “C” compiler pre-processor. //////////////////////////////////////////////////////////////////////////////////// // // Hid<strong>Sensor</strong>Spec.h : Defines compliant with <strong>HID</strong> <strong>Sensor</strong> Spec. // //////////////////////////////////////////////////////////////////////////////////// #ifndef _<strong>HID</strong>SENSORSPEC_H_ #define _<strong>HID</strong>SENSORSPEC_H_ #define <strong>HID</strong>_USAGE_PAGE_SENSOR 0x05,0x20 //sensor category usages #define <strong>HID</strong>_USAGE_SENSOR_TYPE_COLLECTION 0x09,0x01 //sensor category biometric #define <strong>HID</strong>_USAGE_SENSOR_CATEGORY_BIOMETRIC 0x09,0x10 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_BIOMETRIC_PRESENCE 0x09,0x11 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_BIOMETRIC_PROXIMITY 0x09,0x12 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_BIOMETRIC_TOUCH 0x09,0x13 //sensor category electrical #define <strong>HID</strong>_USAGE_SENSOR_CATEGORY_ELECTRICAL 0x09,0x20 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_CAPACITANCE 0x09,0x21 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_CURRENT 0x09,0x22 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_POWER 0x09,0x23 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_INDUCTANCE 0x09,0x24 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_RESISTANCE 0x09,0x25 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_VOLTAGE 0x09,0x26 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_POTENTIOMETER 0x09,0x27 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_FREQUENCY 0x09,0x28 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ELECTRICAL_PERIOD 0x09,0x29 //sensor category environmental #define <strong>HID</strong>_USAGE_SENSOR_CATEGORY_ENVIRONMENTAL 0x09,0x30 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ENVIRONMENTAL_ATMOSPHERIC_PRESSURE 0x09,0x31 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ENVIRONMENTAL_HUMIDITY 0x09,0x32 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ENVIRONMENTAL_TEMPERATURE 0x09,0x33 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ENVIRONMENTAL_WIND_DIRECTION 0x09,0x34 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_ENVIRONMENTAL_WIND_SPEED 0x09,0x35 //sensor category light #define <strong>HID</strong>_USAGE_SENSOR_CATEGORY_LIGHT 0x09,0x40 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LIGHT_AMBIENTLIGHT 0x09,0x41 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LIGHT_CONSUMER_INFRARED 0x09,0x42 //sensor category location #define <strong>HID</strong>_USAGE_SENSOR_CATEGORY_LOCATION 0x09,0x50 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LOCATION_BROADCAST 0x09,0x51 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LOCATION_DEAD_RECKONING 0x09,0x52 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LOCATION_GPS 0x09,0x53 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LOCATION_LOOKUP 0x09,0x54 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LOCATION_OTHER 0x09,0x55 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LOCATION_STATIC 0x09,0x56 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_LOCATION_TRIANGULATION 0x09,0x57 //sensor category mechanical #define <strong>HID</strong>_USAGE_SENSOR_CATEGORY_MECHANICAL 0x09,0x60 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_MECHANICAL_BOOLEAN_SWITCH 0x09,0x61 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_MECHANICAL_BOOLEAN_SWITCH_ARRAY 0x09,0x62 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_MECHANICAL_MULTIVALUE_SWITCH 0x09,0x63 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_MECHANICAL_FORCE 0x09,0x64 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_MECHANICAL_PRESSURE 0x09,0x65 #define <strong>HID</strong>_USAGE_SENSOR_TYPE_MECHANICAL_STRAIN 0x09,0x66