SENSOR_CONTROLLER_CONFIG structure (sensorscx.h)

This structure contains pointers to callback functions that must be implemented by the driver, and passed on to the class extension to call.

Syntax

typedef struct _SENSOR_CONTROLLER_CONFIG {
  ULONG                                             Size;
  WDF_TRI_STATE                                     DriverIsPowerPolicyOwner;
  PFN_SENSOR_DRIVER_START_SENSOR                    EvtSensorStart;
  PFN_SENSOR_DRIVER_STOP_SENSOR                     EvtSensorStop;
  PFN_SENSOR_DRIVER_GET_SUPPORTED_DATA_FIELDS       EvtSensorGetSupportedDataFields;
  PFN_SENSOR_DRIVER_GET_DATA_FIELD_PROPERTIES       EvtSensorGetDataFieldProperties;
  PFN_SENSOR_DRIVER_GET_DATA_INTERVAL               EvtSensorGetDataInterval;
  PFN_SENSOR_DRIVER_SET_DATA_INTERVAL               EvtSensorSetDataInterval;
  PFN_SENSOR_DRIVER_GET_DATA_THRESHOLDS             EvtSensorGetDataThresholds;
  PFN_SENSOR_DRIVER_SET_DATA_THRESHOLDS             EvtSensorSetDataThresholds;
  PFN_SENSOR_DRIVER_GET_PROPERTIES                  EvtSensorGetProperties;
  PFN_SENSOR_DRIVER_DEVICE_IO_CONTROL               EvtSensorDeviceIoControl;
  PFN_SENSOR_DRIVER_START_SENSOR_HISTORY            EvtSensorStartHistory;
  PFN_SENSOR_DRIVER_STOP_SENSOR_HISTORY             EvtSensorStopHistory;
  PFN_SENSOR_DRIVER_CLEAR_SENSOR_HISTORY            EvtSensorClearHistory;
  PFN_SENSOR_DRIVER_START_HISTORY_RETRIEVAL         EvtSensorStartHistoryRetrieval;
  PFN_SENSOR_DRIVER_CANCEL_HISTORY_RETRIEVAL        EvtSensorCancelHistoryRetrieval;
  PFN_SENSOR_DRIVER_SET_BATCH_LATENCY               EvtSensorSetBatchLatency;
  PFN_SENSOR_DRIVER_START_STATE_CHANGE_NOTIFICATION EvtSensorStartStateChangeNotification;
  PFN_SENSOR_DRIVER_STOP_STATE_CHANGE_NOTIFICATION  EvtSensorStopStateChangeNotification;
  PFN_SENSOR_DRIVER_ENABLE_WAKE                     EvtSensorEnableWake;
  PFN_SENSOR_DRIVER_DISABLE_WAKE                    EvtSensorDisableWake;
} SENSOR_CONTROLLER_CONFIG, *PSENSOR_CONTROLLER_CONFIG;

Members

Size

The allocated size of this structure (in bytes).

DriverIsPowerPolicyOwner

Indicates whether or not driver owns the power policy. This value must be either WdfFalse, WdfUseDefault, or WdfTrue. For partners to take advantage of pep-based power management, they must set this flag to WdfFalse or WdfUseDefault and remove any _PSx method in their ACPI tables.

EvtSensorStart

This callback function starts the sensor based on the default properties specified by the driver, or properties set by the class extension.

EvtSensorStop

This callback function stops the sensor.

EvtSensorGetSupportedDataFields

This callback function returns a list of data fields supported by the specified sensor.

EvtSensorGetDataFieldProperties

This callback function returns the properties of a given data field associated with a sensor.

EvtSensorGetDataInterval

This callback function returns the data interval for a specified sensor.

EvtSensorSetDataInterval

This callback function sets the data interval for a specified sensor.

EvtSensorGetDataThresholds

This callback function returns the thresholds that are associated with a sensor.

EvtSensorSetDataThresholds

This callback function stops the sensor.

EvtSensorGetProperties

This callback function returns the properties for a given sensor.

EvtSensorDeviceIoControl

This callback function handles IOCTLs outside of the class extension.

Note  If the driver needs to queue the IRP, it must copy the IRP to an IoQueue that the driver owns. This will prevent all IRPs for the driver to be stalled until completion.

 

EvtSensorStartHistory

EvtSensorStopHistory

EvtSensorClearHistory

EvtSensorStartHistoryRetrieval

EvtSensorCancelHistoryRetrieval

EvtSensorSetBatchLatency

This callback function sets the batch latency for a specified sensor.

EvtSensorStartStateChangeNotification

EvtSensorStopStateChangeNotification

EvtSensorEnableWake

EvtSensorDisableWake

Remarks

This structure is given to the class extension using the SensorsCxDeviceInitialize function. If any of the following function pointers are not set, the driver will fail to load:

  • EvtSensorStart
  • EvtSensorStop
  • EvtSensorGetSupportedDataFields
  • EvtSensorGetDataFieldProperties
  • EvtSensorGetDataInterval
  • EvtSensorSetDataInterval
  • EvtSensorGetDataThresholds
  • EvtSensorSetDataThresholds
  • EvtSensorGetProperties
Each function returns STATUS_SUCCESS when completed successfully.
Note  The class extension (CX) only uses the NT_SUCCESS macro to determine if the call to the driver’s Evt function was successful, but does not take any action if the function failed or does not return STATUS_SUCCESS.
 

Requirements

Requirement Value
Minimum supported client Windows 8.1
Minimum supported server Windows Server 2012 R2
Header sensorscx.h