sensor_get_location_property()
Retrieve one or more location properties for a sensor
Synopsis:
#include <sensor/sensor_api.h>#define sensor_get_location_property(handle,
args...)Arguments:
- handle
- The handle returned by a call to sensor_open().
- args
- A series of property-value pairs where each value must be a pointer to a variable of the expected type.
Library:
libsensorDescription:
This function retrieves one or more location properties for the given sensor. For the args argument, you can provide one or more property-value pairs using a sensor_location_prop_t value as the name of the property and a pointer to the correct type for the value, such as a int or double value. Location information can help you to properly identify where each sensor is located on the device.
The compiler performs no type-checking. Therefore, the value you provide for each property must match the expected data type. Mismatches can cause undefined behavior and application crashes.
sensor_get_location_property(sensor_handle, SENSOR_LOCATION_POSITION_X, &positionX, SENSOR_LOCATION_PITCH, &pitch );
Returns:
SENSOR_EOK when the function successfully completes, otherwise another sensor_error_t value that provides the reason that the call failed.
