Sensors

Overview of the Sensors technology.

To develop Sensors, you need these headers:

For the programming guide, see Sensors.

Class

 
CVEC3D

Math library for a 3D vector.

Enumerations

 
ACTIVITY_STATE

This enumeration represents the activity states reported by the activity detection sensor.
AXIS

Defines 3D coordinates.
LOCATION_DESIRED_ACCURACY

The LOCATION_DESIRED_ACCURACY enumeration type defines values for the SENSOR_PROPERTY_LOCATION_DESIRED_ACCURACY property.
MAGNETOMETER_ACCURACY

This enumeration represents the accuracy states of the magnetometer.
MagnetometerAccuracy

Specifies the accuracy 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.
PROXIMITY_SENSOR_CAPABILITIES

The PROXIMITY_SENSOR_CAPABILITIES enumeration values indicate the capabilities of a proximity sensor.
SENSOR_CONNECTION_TYPES

Defines the types of sensor device connections.
SENSOR_STATE

This enumeration represents the valid states of a sensor.
SensorConnectionType

The SensorConnectionType enumeration type defines values for the SENSOR_CONNECTION_TYPE property.
SENSORSCXFUNCENUM

The _SENSORSCXFUNCENUM enumeration contains a list of all WDF API functions.
SensorState

The SensorState enumeration type specifies the current operational state of a sensor.

Functions

 
~CVEC3D

Destructor for the vector 3d class used in sensor drivers.
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.
CollectionsListAllocateBufferAndSerialize

This routine allocates a buffer and then serializes a sensor collection list to it.
CollectionsListCopyAndMarshall

This routine copies and marshalls a collection list from source to target.
CollectionsListDeserializeFromBuffer

This routine deserializes a collection list from the input buffer.
CollectionsListGetFillableCount

Returns the number of elements a SENSOR_COLLECTION_LIST buffer of a certain size can possibly hold.
CollectionsListGetMarshalledSize

Returns the size needed to accommodate serializing and marshaling a collection list, including embedded memory.
CollectionsListGetMarshalledSizeWithoutSerialization

Returns the size of the entire collection list, including size of memories blocks that are pointed by embedded pointers.
CollectionsListGetSerializedSize

This routine returns the larger of the two sizes to provide for sufficient buffer sizes to accommodate passing the collection list across processes that can have different bit-ness values.
CollectionsListMarshall

This routine is similar to CollectionsListCopyAndMarshall, except that it marshalls a collection list in-place.
CollectionsListSerializeToBuffer

This routine serializes a collection list to the caller-allocated buffer.
CollectionsListSortSubscribedActivitiesByConfidence

This routine rearranges activity data collection under certain conditions.
CollectionsListUpdateMarshalledPointer

This routine update embedded pointers.
CVEC3D

3d vector class used in sensor driver development.
CVEC3D

3d vector class used in sensor driver development, with 3d vector parameter.
CVEC3D

3d vector class constructor used in sensor driver development, with float parameters.
EvaluateActivityThresholds

This routine determines whether the new incoming activity data meets the threshold.
EVT_SENSOR_DRIVER_CANCEL_HISTORY_RETRIEVAL

Cancels history retrieval from the sensor.
EVT_SENSOR_DRIVER_CLEAR_SENSOR_HISTORY

Clears the history recorded so far in the sensor.
EVT_SENSOR_DRIVER_DEVICE_IO_CONTROL

Callback to handle IOCTL.
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 sets the threshold for one or more data fields associated with a sensor.
EVT_SENSOR_DRIVER_START_HISTORY_RETRIEVAL

Starts retrieving the history recorded so far in the sensor.
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_SENSOR_HISTORY

Starts recording history in the sensor.
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_SENSOR_HISTORY

Stops recording history in the sensor.
EVT_SENSOR_DRIVER_STOP_STATE_CHANGE_NOTIFICATION

Used to stop a state change notification.
FloatEq

This function tests equality with FLOAT_TOLERANCE = 0.00001.
GetMethodArgumentFromAcpi

The GetMethodArgumentFromAcpi function reads the requested ACPI entry using the supplied method name.
GetPerformanceTime

This routine calculates system time in milliseconds.
GetRotationMatrixFromAcpi

The GetRotationMatrixFromAcpi function reads the rotation matrix from the ACPI entries.
I2C_REQUEST_SIZE

The I2C_REQUEST_SIZE macro defines the I2C request size.
I2CSensorReadRegister

The I2CSensorReadRegister function reads the devices register(s) over I2C.
I2CSensorWriteRegister

The I2CSensorWriteRegister function writes to the device register(s) over I2C.
Initialize

The ISensorClassExtension::Initialize method initializes the sensor class extension object.
InitPropVariantFromCLSIDArray

This routine initializes a PROPVARIANT from a given array of GUIDs.
InitPropVariantFromFloat

This routine initializes a PROPVARIANT with the given float.
InitTransformationMatrix

The InitTransformationMatrix function reads the rotation matrix from the ACPI entries.
IsCollectionListSame

This routine compares two collection lists to see if they are the same.
IsGUIDPresentInList

This routine looks for a GUID in a list of GUIDs.
IsKeyPresentInCollectionList

This routine determine if a key is present in a collection list.
IsKeyPresentInPropertyList

This routine determine if a key is present in a property list.
IsSensorSubscribed

For internal use only.
MILLISECONDS_FROM_100NANOSECONDS

This macro converts time, provided as 100 nanosecond units, to milliseconds.
MILLISECONDS_TO_100NANOSECONDS

This macro converts time, in milliseconds, to 100 nanosecond units.
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.
operator+=

Assignment operator +.
operator-=

Assignment operator -.
ParseRotationMatrixEntry

The ParseRotationMatrixEntry function parses a string of three floats.
PFN_SENSORSCXDEVICEGETSENSORLIST

Returns a list of sensor instances associated with a WDFDEVICE.
PFN_SENSORSCXDEVICEINITCONFIG

Configures the sensor device.
PFN_SENSORSCXDEVICEINITIALIZE

Initializes the sensor in the class extension.
PFN_SENSORSCXSENSORCREATE

Creates an instance of a sensor in the class extension.
PFN_SENSORSCXSENSORDATAREADY

Notifies the class extension that the driver has retrieved data.
PFN_SENSORSCXSENSORHISTORYRETRIEVALCOMPLETED

Indicates that the history retrieval has completed.
PFN_SENSORSCXSENSORINITIALIZE

Sets the enumeration properties of a sensor.
PFN_SENSORSCXSTATECHANGE

Used to initialize a sensor state change.
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.
PropertiesListCopy

This routine copies a properties list from source to target.
PropertiesListGetFillableCount

Returns the number of elements a properties list buffer of a certain size can possibly hold.
PropKeyFindKeyGetBool

This routine gets a BOOL value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetDouble

This routine gets a double precision floating point value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetFileTime

This routine gets a FILETIME value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetFloat

This routine gets a single precision floating point value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetGuid

This routine gets a GUID value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetInt32

This routine gets a INT32 value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetInt64

This routine gets a INT64 value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetNthInt64

This routine gets the nth INT64 value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetNthUlong

This routine gets the nth ULONG value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetNthUshort

This routine gets the nth USHORT value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetPropVariant

This routine finds the PROPVARIANT from a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetUlong

This routine gets a ULONG value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeyGetUshort

This routine gets a USHORT value from a PROPVARIANT within a collection list based on the PROPERTYKEY.
PropKeyFindKeySetPropVariant

This routine finds and sets the PROPVARIANT within a collection list based on the PROPERTYKEY.
PropVariantGetInformation

This routine gets offset, size, location pointer and DEVPROPTYPE, of a PROPVARIANT.
RealModulo

Calculates the modular value between x and y.
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_CONFIG_INIT

This function initializes a SENSOR_CONFIG structure.
SENSOR_CONTROLLER_CONFIG_INIT

This function initializes a SENSOR_CONTROLLER_CONFIG 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.
SensorCollectionGetAt

This routine returns the PROPERTYKEY and PROPVARIANT associated with the nth element in the provided sensor collection list.
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.
SensorsCxSensorHistoryRetrievalCompleted

The SensorsCxSensorHistoryRetrievalCompleted function indicates that the history retrieval has completed.
SensorsCxSensorInitialize

This function sets the enumeration properties of a sensor.
SensorsCxStateChange

Used to initialize a state change.
SerializationBufferAllocate

Exported memory allocation function for allocating a serialized buffer.
SerializationBufferFree

Exported memory allocation function for freeing a serialization buffer.
TranslateAxes

The TranslateAxes function applies the rotation matrix to the given sample.
Uninitialize

The ISensorClassExtension::Uninitialize method uninitializes the sensor class extension object.

Interfaces

 
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

 
I2C_REQUEST

An I2C request.
MATRIX3X3

Defines a 3x3 matrix.
QUATERNION

A structure that represents a 4-dimensional vector used for simple 3D rotation operation.
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_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_PROPERTY_LIST

Learn how 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.
VEC3D

Defines a 3D vector.