ISensor::GetData method

Retrieves the most recent sensor data report.

Syntax


HRESULT GetData(
  [out]  ISensorDataReport **ppDataReport
);

Parameters

ppDataReport [out]

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 codeDescription
S_OK

The method succeeded.

E_INVALIDARG

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.

HRESULT_FROM_WIN32(ERROR_NO_DATA)

The sensor has no data to report. For example, a GPS sensor could be in the process of acquiring a satellite fix.

E_POINTER

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

Minimum supported client

Windows 7 [desktop apps only]

Minimum supported server

None supported

Header

Sensorsapi.h

Library

Sensorsapi.lib

DLL

Sensorsapi.dll

See also

ISensor
Managing User Permissions
RequestPermissions
Sensor Categories, Types, and Data Fields

 

 

Community Additions

ADD
Show:
© 2014 Microsoft