Retrieve the normalized proximity from a SENSOR_PROXIMITY_READING event.
BPS_API float sensor_event_get_proximity_normalized(bps_event_t *event)
The SENSOR_PROXIMITY_READING event to get the normalized proximity from.
Library:libbps (For the qcc command, use the -l bps option to link against this library)
The sensor_event_get_proximity_normalized() function gets the proximity from the specified SENSOR_PROXIMITY_READING event and normalizes it to a value between 0.0f and 1.0f. Where 0.0f is close and 1.0f is far. The normalized proximity is a unitless value.
Note that while the proximity from an event is normalized to a value in the range of 0.0f to 1.0f, it is common that the full range of values is not seen. This is because it is difficult for many proximity sensors to register values at the top end of their range, and the normalized value is calculated against the full range of the sensor. For this reason, it is important to consider the relative change in proximity, rather than the absolute proximity values.
The proximity as a unitless measurement between 0.0f (close) and 1.0f (far) when the function completes successfully, NaN with the errno value set otherwise.
Last modified: 2014-05-14