Sensor driver file list

The files in a sensor sample driver source-file folder fall into two general categories. The first category consists of general files that are common to a UMDF sensor driver. The second consists of sensor-specific files that are required to support a specific HID-based sensor.

The following table describes the general files that are common to a UMDF sensor driver.

File name Contents
Device.cpp Contains an implementation of the CMyDevice member functions. This includes the OnPrepareHardware method which creates and initializes the sensor class extension.
Device.h Contains a definition for the CMyDevice class.
Dllsup.cpp Contains the driver DLL’s entry point (DLLMain).
Driver.cpp Contains an implementation of the CMyDriver member functions. This includes the OnDeviceAdd method that creates an instance of the CMyDevice class (see description of Device.cpp).
Driver.h Contains a definition of the CMyDriver class.
Internal.h Contains local type definitions for the sample driver. These include sensor-specific HID definitions and general HID definitions.
Makefile.inc Required to build an .INF file.
Queue.cpp Contains an implementation of the CMyQueue member functions. This includes the CreateInstance method, which creates an instance of the I/O queue for the device. It also includes the OnDeviceIoControl method that forwards WPD I/O requests to the sensor class extension.
Queue.h Contains a definition of the CMyQueue class.
Resource.h Contains definitions consumed by SensorsSimpleHIDClassDriver.h.
Sensor.cpp Contains an implementation of the CSensor member functions. This includes the methods which return lists of supported properties and data fields and the methods which set writable properties and data fields.
Sensor.h Contains a definition of the CSensor class.
SensDDI.cpp Contains an implementation of the ISensorDriver callback interface in the CSensorDdi class. The sensor class extension calls methods in this interface to retrieve supported data such as objects, properties, and events.
SensorManager.cpp Contains an implementation of the CSensorManager class. The methods in this class, as the name implies, manage the sensor device: starting it, stopping it, retrieving the device state, and so on.
SensorManager.h Contains the definition of the CSensorManager class.
SensorsHIDClassDriver.def Declares the module parameters.
SensorsHIDClassDriver.htm Contains a high-level description of the sample driver.
SensorsHIDClassDriver.idl Contains the necessary definitions for the driver’s COM component.
SensorsHIDClassDriver.inf Contains the information that Windows Setup requires when you install the in-box driver on x86 and amd64 computers.
SensorsHIDClassDriver.rc Contains definitions for resources that the driver requires, such as file type, file description string, file version, and original file name.
SensorsHIDClassDriver-Win8x86Manual.inf Contains the information that is required when you manually install the driver on x86.
Sources Contains a series of macro definitions that are recognized by the Build utility

 

The following table lists the files that support the 18 categories of sensors enabled by the sample driver. All these categories return a timestamp data field. The table lists any additional data field associated with a particular class.

File name Contents
Accelerometer.cpp Contains an implementation of the CAccelerometer class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported datafields return acceleration for 1-, 2-, and 3-axis devices.
Accelerometer.h Contains the definition of the CAccelerometer class.
AmbientLIght.cpp Contains an implementation of the CAmbientLight class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data fields return LUX, light temperature in degrees Kelvin, and chromacity.
AmbientLight.h Contains the definition of the CAmbientLight class.
AtmosPressure.cpp Contains an implementation of the CBarometer class. The methods in this class initialize the sensor, retrieve readable properties and process asynchronous data from the sensor. The supported data field returns the atmospheric pressure.
AtmosPressure.h Contains the definition of the CBarometer class.
Compass.cpp Contains an implementation of the CCompass class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data fields include the compass heading in X-, Y-, and Z-degrees and the compensated and uncompensated magnetic and true-north headings.
Compass.h Contains the definition of the CCompass class.
Current.cpp Contains an implementation of the CCurrent class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data field includes the current as measured in amps.
Current.h Contains the definition of the CCurrent class
Custom.cpp Contains an implementation of the CCustom class. The methods in this class: initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. If you create a unique sensor that is not supported by existing classes in the driver, you can use this class to support your device.
Custom.h Contains the definition of the CCustom class.
Distance.cpp Contains an implementation of the CDistance class. The methods in this class: initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data fields include distance measurements for 1-, 2-, and 3-axis devices.
Distance.h Contains the definition of the CDistance class.
Frequency.cpp Contains an implementation of the CFrequency class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data field can be used to measure periodic events such as fan speed.
Frequency.h Contains the definition of the CFrequency class.
Generic.cpp Contains an implementation of the CGeneric class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor.

A custom sensor presents itself to the sensor API as a custom device with certain properties. A generic sensor, on the other hand, presents itself by using category and type fields that are defined in Sensors.h.

Generic.h Contains the definition of the CGeneric class.
Gyrometer.cpp Contains an implementation of the CGyrometer class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data fields measure angular acceleration and support 1-, 2-, and 3-axis sensors.
Gyrometer.h Contains the definition of the CGyrometer class.
Humidity.cpp Contains an implementation of the CHumidity class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data field measures relative humidity as a percentage.
Humidity.h Contains the definition of the CHumidity class.
Inclinometer.cpp Contains an implementation of the CInclinometer class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data fields measure incline for 1-, 2-, and 3-axis sensors.
Inclinometer.h Contains the definition of the CInclinometer class.
Orientation.cpp Contains an implementation of the COrientation class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data fields measure device orientation by using an aggregation of several sensors.
Orientation.h Contains the definition of the COrientation class.
Potentiometer.cpp Contains an implementation of the CPotentiometer class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data field returns a percentage of the maximum range.
Potentiometer.h Contains the definition of the CPotentiometer class.
Power.cpp Contains an implementation of the CPower class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported data field measures power in watts.
Power.h Contains the definition of the CPower class.
Presence.cpp Contains an implementation of the CPresence class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. This class supports two sets of datafields. The first returns human presence status, and the second returns human proximity data in meters.
Presence.h Contains the definition of the CPresence class.
Switches.cpp Contains an implementation of the CSwitch class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. This class supports multiple sets of datafields. The simplest returns a single Boolean switch state, another returns the state of an array of Boolean switches, another returns the state of a multivalue switch, and so on.
Switches.h Contains the definition of the CSwitch class.
Thermometer.cpp Contains an implementation of the CThermometer class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported datafield returns the current temperature in degrees Celsius.
Thermometer.h Contains the definition of the CThermometer class.
Unsupported.cpp Contains an implementation of the CUnsupported class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. This class supports a single timestamp datafield.
Unsupported.h Contains the definition of the CUnsupported class.
Voltage.cpp Contains an implementation of the CVoltage class. The methods in this class initialize the sensor, retrieve readable properties, set writable properties, and process asynchronous data from the sensor. The supported datafield is a voltage measurement.
Voltage.h Contains the definition of the CVoltage class.

 

The Sensor Diagnostic Tool

The Sensors HID Driver Sample

Writing a Sensor Device Driver

 

 

Send comments about this topic to Microsoft

Build date: 11/29/2012