ISensor::GetData method (sensorsapi.h)
Retrieves the most recent sensor data report.
Syntax
HRESULT GetData(
[out] ISensorDataReport **ppDataReport
);
Parameters
[out] ppDataReport
Address of an ISensorDataReport pointer that receives the pointer to the most recent sensor data report.
Return value
The method returns an HRESULT. Possible values include, but are not limited to, those in the following table.
Return code | Description |
---|---|
|
The method succeeded. |
|
The sensor driver provided badly formed data. For example, the data was of a type that is not supported. For information about data types of platform-defined data fields, see Sensor Categories, Types, and Data Fields. |
|
The sensor has no data to report. For example, a GPS sensor could be in the process of acquiring a satellite fix. |
|
NULL was passed in for ppDataReport. |
Remarks
For location sensors, you can retrieve data only from sensors for which the user has granted permission.
This method may return data before the driver has set the state to SENSOR_STATE_READY.
Examples
For an example of how to retrieve sensor data, see Retrieving Sensor Data Values.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 7 [desktop apps only] |
Minimum supported server | None supported |
Target Platform | Windows |
Header | sensorsapi.h |
Library | Sensorsapi.lib |
DLL | Sensorsapi.dll |