Edit

Share via


Creating a persistent unique identifier for a sensor

Your driver must create a persistent unique identifier (PUID) for each sensor. A PUID is a GUID value that is stored across sessions and uniquely identifies the object on the device. Your driver must return the PUID value when queried for the property named DEVPKEY_Sensor_PersistentUniqueId. If a device contains multiple sensors, each sensor must be assigned its own PUID. Applications can retrieve this ID by using the Windows.Devices.Enumeration WinRT APIs.

You should create a new PUID for each sensor, when the sensor first connects to the computer, and then store this value for later use.

Your driver should create or retrieve the PUID before calling the SensorsCxSensorInitialize initialization routine. This function supplies a pointer to the SENSOR_CONFIG structure that holds the sensor configuration. You can use this pointer to access a specific property store for each device.

Sensors Driver ADXL345Acc Sample