From 581398d3ab20c427f37f0b1bd68a8a1d13789bae Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Tue, 12 Sep 2017 19:46:04 -0700 Subject: binding: gps: check error flags for data struct Check to be sure no error flags are set to avoid having multiple partial events in a short span (under a second). This is will reduce processing from consumers of the gps binding, and assure all values are updated and valid at the same instant. Bug-AGL: SPEC-844 Change-Id: I8765481b7eef4c25087798e167b39680ad56e0cc Signed-off-by: Matt Ranostay --- binding/afm-gps-binding.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/binding/afm-gps-binding.c b/binding/afm-gps-binding.c index cadc6d2..ea40331 100644 --- a/binding/afm-gps-binding.c +++ b/binding/afm-gps-binding.c @@ -156,9 +156,11 @@ static void *data_poll(void *ptr) break; } - jresp = populate_json_data(json_object_new_object()); - if (jresp != NULL) - afb_event_push(location_event, jresp); + if (!(data.set & (TRACKERR_SET | SPEEDERR_SET| CLIMBERR_SET))) { + jresp = populate_json_data(json_object_new_object()); + if (jresp != NULL) + afb_event_push(location_event, jresp); + } pthread_mutex_unlock(&mutex); } -- cgit 1.2.3-korg