sensor_event_is_heading_flipped()

Determine whether the compass heading is flipped.

Synopsis:

#include <bps/sensor.h>
 
BPS_API int sensor_event_is_heading_flipped(bps_event_t *event,
                                            bool *is_flipped)

Since:

BlackBerry 10.2.0

Arguments:

event

The SENSOR_COMPASS_READING event to get the value from.

is_flipped

This is set to true if the device is face down, false otherwise.

Library:

libbps (For the qcc command, use the -l bps option to link against this library)

Description:

The sensor_event_is_heading_flipped() function sets is_flipped to true if the device is face down. When the device is face down, turning the device clockwise will report the same heading as turning it counter-clockwise if the device was face up. is_flipped is set to false if the device is face up and the heading is not flipped. The value is retrieved from a SENSOR_COMPASS_READING event.

Returns:

On success, BPS_SUCCESS is returned and is_flipped is set. If the event passed in is not a SENSOR_COMPASS_READING event or if is_flipped is NULL, BPS_FAILURE will be returned with errno set appropriately.

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus