Sensors

Overview of the Sensors technology.

To develop Sensors, you need these headers:

For the programming guide, see Sensors.

Functions

Title Description
SENSOR_COLLECTION_LIST_CALCULATE_MAX_COUNT function This function calculates the number of SENSOR_VALUE_PAIR elements in a SENSOR_COLLECTION_LIST structure.
SENSOR_COLLECTION_LIST_INIT function This function initializes a SENSOR_COLLECTION_LIST structure.
SENSOR_COLLECTION_LIST_SIZE function This function returns the size of a SENSOR_COLLECTION_LIST structure.
SENSOR_CONFIG_INIT function This function initializes a SENSOR_CONFIG structure.
SENSOR_CONTROLLER_CONFIG_INIT function This function initializes a SENSOR_CONTROLLER_CONFIG structure.
SENSOR_PROPERTY_LIST_CALCULATE_MAX_COUNT function This function calculates the number of PROPERTYKEY elements.
SENSOR_PROPERTY_LIST_INIT function This function initializes a SENSOR_PROPERTY_LIST structure.
SENSOR_PROPERTY_LIST_SIZE function This function returns the size of the property list.
SensorsCxDeviceGetSensorList function This function returns a list of sensor instances associated with a WDFDEVICE.
SensorsCxDeviceInitConfig function This function configures the sensor device.
SensorsCxDeviceInitialize function This function initializes the sensor in the class extension.
SensorsCxSensorCreate function This function creates an instance of a sensor in the class extension.
SensorsCxSensorDataReady function This function notifies the class extension that the driver has retrieved data.
SensorsCxSensorInitialize function This function sets the enumeration properties of a sensor.
SensorsCxStateChange function Used to initialize a state change.

Callback functions

Title Description
EVT_SENSOR_DRIVER_DISABLE_WAKE callback function Callback to disable wake for the sensor.
EVT_SENSOR_DRIVER_ENABLE_WAKE callback function Callback to enable wake for the sensor.
EVT_SENSOR_DRIVER_GET_DATA_FIELD_PROPERTIES callback function This callback function returns the properties of a given data field associated with a sensor.
EVT_SENSOR_DRIVER_GET_DATA_INTERVAL callback function This callback function returns the data interval for a specified sensor.
EVT_SENSOR_DRIVER_GET_DATA_THRESHOLDS callback function This callback function returns the thresholds that are associated with a sensor.
EVT_SENSOR_DRIVER_GET_PROPERTIES callback function This callback function returns the properties for a given sensor.
EVT_SENSOR_DRIVER_GET_SUPPORTED_DATA_FIELDS callback function This callback function returns a list of data fields supported by the specified sensor.
EVT_SENSOR_DRIVER_SET_BATCH_LATENCY callback function This callback function sets the batch latency for a specified sensor.
EVT_SENSOR_DRIVER_SET_DATA_INTERVAL callback function This callback function sets the data interval for a specified sensor.
EVT_SENSOR_DRIVER_SET_DATA_THRESHOLDS callback function This callback function handles IOCTLs outside of the class extension.
EVT_SENSOR_DRIVER_START_SENSOR callback function This callback function starts the sensor based on the default properties specified by the driver, or properties set by the class extension.
EVT_SENSOR_DRIVER_START_STATE_CHANGE_NOTIFICATION callback function Used to start a state change notification.
EVT_SENSOR_DRIVER_STOP_SENSOR callback function This callback function stops the sensor.
EVT_SENSOR_DRIVER_STOP_STATE_CHANGE_NOTIFICATION callback function Used to stop a state change notification.

Structures

Title Description
SENSOR_COLLECTION_LIST structure This structure contains a list of all SENSOR_VALUE_PAIR structures for each sensor. This structure is returned by calling ReadFile.
SENSOR_PROPERTY_LIST structure This structure contains a list of all SENSOR_VALUE_PAIR structures for each sensor. This structure is returned by calling ReadFile.
SENSOR_VALUE_PAIR structure This structure pairs the property keys listed in the Sensor properties section with the data that each key represents.
_SENSOR_CONFIG structure This structure contains information that the sensor driver passes to the class extension about each sensor.
_SENSOR_CONTROLLER_CONFIG structure This structure contains pointers to callback functions that must be implemented by the driver, and passed on to the class extension to call.

Enumerations

Title Description
ACTIVITY_STATE enumeration This enumeration represents the activity states reported by the activity detection sensor.
LOCATION_DESIRED_ACCURACY enumeration The LOCATION_DESIRED_ACCURACY enumeration type defines values for the SENSOR_PROPERTY_LOCATION_DESIRED_ACCURACY property.
MAGNETOMETER_ACCURACY enumeration This enumeration represents the accuracy states of the magnetometer.
MagnetometerAccuracy enumeration Specifies the accuracy of the magnetometer.
PEDOMETER_STEP_TYPE enumeration This enumeration represents the step types reported by the pedometer.
PEDOMETER_STEP_TYPE_COUNT enumeration This enumeration represents the number of step types that can be detected by the pedometer.
SENSOR_STATE enumeration This enumeration represents the valid states of a sensor.
__MIDL___MIDL_itf_windowssensorclassextension_0000_0000_0001 enumeration The SensorState enumeration type specifies the current operational state of a sensor.
__MIDL___MIDL_itf_windowssensorclassextension_0000_0000_0002 enumeration The SensorConnectionType enumeration type defines values for the SENSOR_CONNECTION_TYPE property.

Interfaces

Title Description
ISensorClassExtension interface The ISensorClassExtension interface provides methods that the sensor driver uses to communicate with the sensor platform (and, therefore, client applications) through the sensor class extension object.
ISensorDriver interface The ISensorDriver interface provides callback methods that the sensor class extension uses to provide requests and notifications to the sensor driver.

Methods

Title Description
ISensorClassExtension::CleanupFile The ISensorClassExtension
ISensorClassExtension::Initialize The ISensorClassExtension
ISensorClassExtension::PostEvent The ISensorClassExtension
ISensorClassExtension::PostStateChange The ISensorClassExtension
ISensorClassExtension::ProcessIoControl The ISensorClassExtension
ISensorClassExtension::Uninitialize The ISensorClassExtension
ISensorDriver::OnClientConnect The ISensorDriver
ISensorDriver::OnClientDisconnect The ISensorDriver
ISensorDriver::OnClientSubscribeToEvents The ISensorDriver
ISensorDriver::OnClientUnsubscribeFromEvents The ISensorDriver
ISensorDriver::OnGetDataFields The ISensorDriver
ISensorDriver::OnGetProperties The ISensorDriver
ISensorDriver::OnGetSupportedDataFields The ISensorDriver
ISensorDriver::OnGetSupportedEvents The ISensorDriver
ISensorDriver::OnGetSupportedProperties The ISensorDriver
ISensorDriver::OnGetSupportedSensorObjects The ISensorDriver
ISensorDriver::OnProcessWpdMessage The ISensorDriver
ISensorDriver::OnSetProperties The ISensorDriver

IOCTLs

Title Description

Enumerations

Title Description
__MIDL___MIDL_itf_windowssensorclassextension_0000_0000_0001 The SensorState enumeration type specifies the current operational state of a sensor.
__MIDL___MIDL_itf_windowssensorclassextension_0000_0000_0002 The SensorConnectionType enumeration type defines values for the SENSOR_CONNECTION_TYPE property.
LOCATION_DESIRED_ACCURACY The LOCATION_DESIRED_ACCURACY enumeration type defines values for the SENSOR_PROPERTY_LOCATION_DESIRED_ACCURACY property.
MagnetometerAccuracy Specifies the accuracy of the magnetometer.
ACTIVITY_STATE This enumeration represents the activity states reported by the activity detection sensor.
MAGNETOMETER_ACCURACY This enumeration represents the accuracy states of the magnetometer.
PEDOMETER_STEP_TYPE This enumeration represents the step types reported by the pedometer.
PEDOMETER_STEP_TYPE_COUNT This enumeration represents the number of step types that can be detected by the pedometer.
SENSOR_STATE This enumeration represents the valid states of a sensor.

Functions

Title Description
CleanupFile The ISensorClassExtension::CleanupFile method notifies the class extension about a file handle that closes and cancels all pending I/O requests, for the specified application.
Initialize The ISensorClassExtension::Initialize method initializes the sensor class extension object.
PostEvent The ISensorClassExtension::PostEvent method raises one or more driver events in the sensor class extension.
PostStateChange The ISensorClassExtension::PostStateChange method notifies the sensor class extension about a change in the operational state of the sensor.
ProcessIoControl The ISensorClassExtension::ProcessControl method sends Windows Portable Devices (WPD) I/O control requests to the sensor class extension for processing.
Uninitialize The ISensorClassExtension::Uninitialize method uninitializes the sensor class extension object.
OnClientConnect The ISensorDriver::OnClientConnect method notifies the sensor driver that a client application has connected.
OnClientDisconnect The ISensorDriver::OnClientDisconnect method notifies the sensor driver that a client application has disconnected.
OnClientSubscribeToEvents The ISensorDriver::OnClientSubscribeToEvents method notifies the sensor driver that an authorized client application is requesting event notifications.
OnClientUnsubscribeFromEvents The ISensorDriver::OnClientUnsubscribeFromEvents method notifies the sensor driver that a client application no longer requests event notifications.
OnGetDataFields The ISensorDriver::OnGetDataFields method retrieves current sensor data.
OnGetProperties The ISensorDriver::OnGetProperties method retrieves values for the specified properties from the specified sensor.
OnGetSupportedDataFields The ISensorDriver::OnGetSupportedDataFields method retrieves the list of data fields that the specified sensor can provide.
OnGetSupportedEvents The ISensorDriver::OnGetSupportedEvents method retrieves the list of events that the specified sensor can raise.
OnGetSupportedProperties The ISensorDriver::OnGetSupportedProperties method retrieves the list of properties that the specified sensor provides.
OnGetSupportedSensorObjects The ISensorDriver::OnGetSupportedSensorObjects method retrieves the list of sensors that the driver provides.
OnProcessWpdMessage The ISensorDriver::OnProcessWpdMessage method handles Windows Portable Device (WPD) commands that the ISensorClassExtension::ProcessIoControl method does not handle internally.
OnSetProperties The ISensorDriver::OnSetProperties method specifies values for the specified list of properties.
EVT_SENSOR_DRIVER_DISABLE_WAKE Callback to disable wake for the sensor.
EVT_SENSOR_DRIVER_ENABLE_WAKE Callback to enable wake for the sensor.
EVT_SENSOR_DRIVER_GET_DATA_FIELD_PROPERTIES This callback function returns the properties of a given data field associated with a sensor.
EVT_SENSOR_DRIVER_GET_DATA_INTERVAL This callback function returns the data interval for a specified sensor.
EVT_SENSOR_DRIVER_GET_DATA_THRESHOLDS This callback function returns the thresholds that are associated with a sensor.
EVT_SENSOR_DRIVER_GET_PROPERTIES This callback function returns the properties for a given sensor.
EVT_SENSOR_DRIVER_GET_SUPPORTED_DATA_FIELDS This callback function returns a list of data fields supported by the specified sensor.
EVT_SENSOR_DRIVER_SET_BATCH_LATENCY This callback function sets the batch latency for a specified sensor.
EVT_SENSOR_DRIVER_SET_DATA_INTERVAL This callback function sets the data interval for a specified sensor.
EVT_SENSOR_DRIVER_SET_DATA_THRESHOLDS This callback function handles IOCTLs outside of the class extension.
EVT_SENSOR_DRIVER_START_SENSOR This callback function starts the sensor based on the default properties specified by the driver, or properties set by the class extension.
EVT_SENSOR_DRIVER_START_STATE_CHANGE_NOTIFICATION Used to start a state change notification.
EVT_SENSOR_DRIVER_STOP_SENSOR This callback function stops the sensor.
EVT_SENSOR_DRIVER_STOP_STATE_CHANGE_NOTIFICATION Used to stop a state change notification.
SENSOR_CONFIG_INIT This function initializes a SENSOR_CONFIG structure.
SENSOR_CONTROLLER_CONFIG_INIT This function initializes a SENSOR_CONTROLLER_CONFIG structure.
SensorsCxDeviceGetSensorList This function returns a list of sensor instances associated with a WDFDEVICE.
SensorsCxDeviceInitConfig This function configures the sensor device.
SensorsCxDeviceInitialize This function initializes the sensor in the class extension.
SensorsCxSensorCreate This function creates an instance of a sensor in the class extension.
SensorsCxSensorDataReady This function notifies the class extension that the driver has retrieved data.
SensorsCxSensorInitialize This function sets the enumeration properties of a sensor.
SensorsCxStateChange Used to initialize a state change.
SENSOR_COLLECTION_LIST_CALCULATE_MAX_COUNT This function calculates the number of SENSOR_VALUE_PAIR elements in a SENSOR_COLLECTION_LIST structure.
SENSOR_COLLECTION_LIST_INIT This function initializes a SENSOR_COLLECTION_LIST structure.
SENSOR_COLLECTION_LIST_SIZE This function returns the size of a SENSOR_COLLECTION_LIST structure.
SENSOR_PROPERTY_LIST_CALCULATE_MAX_COUNT This function calculates the number of PROPERTYKEY elements.
SENSOR_PROPERTY_LIST_INIT This function initializes a SENSOR_PROPERTY_LIST structure.
SENSOR_PROPERTY_LIST_SIZE This function returns the size of the property list.

Interfaces

Title Description
ISensorClassExtension The ISensorClassExtension interface provides methods that the sensor driver uses to communicate with the sensor platform (and, therefore, client applications) through the sensor class extension object.
ISensorDriver The ISensorDriver interface provides callback methods that the sensor class extension uses to provide requests and notifications to the sensor driver.

Structures

Title Description
_SENSOR_CONFIG This structure contains information that the sensor driver passes to the class extension about each sensor.
_SENSOR_CONTROLLER_CONFIG This structure contains pointers to callback functions that must be implemented by the driver, and passed on to the class extension to call.
SENSOR_COLLECTION_LIST This structure contains a list of all SENSOR_VALUE_PAIR structures for each sensor. This structure is returned by calling ReadFile.
SENSOR_PROPERTY_LIST This structure contains a list of all SENSOR_VALUE_PAIR structures for each sensor. This structure is returned by calling ReadFile.
SENSOR_VALUE_PAIR This structure pairs the property keys listed in the Sensor properties section with the data that each key represents.