sensor_get_location_property()

Retrieve one or more location properties for a given sensor

Synopsis:

#include <sensor/sensor_api.h>
sensor_get_location_property(sensor_handle_t handle,
                             args...)

Arguments:

handle
The handle returned by a call to the sensor_open() function.
args...
A series of comma-delimited property-value pairs where each value must be a pointer to a variable of the expected type.

Library:

libsensor

Description:

For the args argument, you can provide one or more property-value pairs using sensor_location_prop_t values as the name of the property and a pointer to the correct type for the value such as an int or double value. For more information about the correct types to use, see sensor_location_prop_t. Location information can provide you information in order to properly identify where each sensor is located on the device.

Note:

There's no type-checking performed by the compiler, therefore, you must ensure that the value you provide for each property matches the expected data type. Data type mismatches can result in undefined behavior and may cause your application to crash.

You can specify multiple property-value pairs by delimiting them with a comma as follows:
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.