Sensors

Overview of the Sensors technology.

To develop Sensors, you need these headers:

For the programming guide, see Sensors.

Class

Title Description
CVEC3D Math library for a 3D vector.

Enumerations

Title Description
SensorState The SensorState enumeration type specifies the current operational state of a sensor.
SensorConnectionType 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.
AXIS Defines 3D coordinates.

Functions

Title Description
~CVEC3D Destructor for the vector 3d class used in sensor drivers.
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.
operator+= Assignment operator +.
operator-= Assignment operator -.
FloatEq This function tests equality with FLOAT_TOLERANCE = 0.00001.
RealModulo Calculates the modular value between x and y.
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 sets the threshold for one or more data fields associated with a 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_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.
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.
EvaluateActivityThresholds This routine determines whether the new incoming activity data meets the threshold.
GetPerformanceTime This routine calculates system time in milliseconds.
InitPropVariantFromCLSIDArray This routine initializes a PROPVARIANT from a given array of GUIDs.
InitPropVariantFromFloat This routine initializes a PROPVARIANT with the given float.
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.
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.
SensorCollectionGetAt This routine returns the PROPERTYKEY and PROPVARIANT associated with the nth element in the provided sensor collection list.
SerializationBufferAllocate Exported memory allocation function for allocating a serialized buffer.
SerializationBufferFree Exported memory allocation function for freeing a serialization buffer.

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.
VEC3D Defines a 3D vector.
MATRIX3X3 Defines a 3x3 matrix.
QUATERNION A structure that represents a 4-dimensional vector used for simple 3D rotation operation.