Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Super Contributor
Posts: 253
Registered: ‎08-19-2010
My Device: BB10, Playbook, 9900, 9800, 9700, 9550, 9530, 9500, 8700.
My Carrier: TT
Accepted Solution

Is it possible to get GPS raw data and sensor data in a single program.

GPS and sensor.h are used the bps_event_get_domain(event).

 

if (bps_event_get_domain(event) == sensor_get_domain() && bps_event_get_domain(event) == geolocation_get_domain()) {

 

How to collect sensor data and GPS data in the same program without conflit??

 

Thank your attention.

 

-Fight with BB10
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Is it possible to get GPS raw data and sensor data in a single program.

[ Edited ]

I'm a bit puzzled, but would it work for you to simply change the && (AND) into a || (OR) ?

If not, I don't know if your question is clear enough.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Highlighted
Retired
Posts: 38
Registered: ‎10-26-2011
My Device: BlackBerry Bold 9900
My Carrier: Rogers

Re: Is it possible to get GPS raw data and sensor data in a single program.

You should structure your code like:

 

if (bps_event_get_domain(event) == sensor_get_domain()) {

    /* handle sensor event */

} else if (bps_event_get_domain(event) == geolocation_get_domain()) {

    /* handle geolocation event */

}