summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2017-09-12 19:46:04 -0700
committerMatt Ranostay <matt.ranostay@konsulko.com>2017-09-12 20:25:15 -0700
commit581398d3ab20c427f37f0b1bd68a8a1d13789bae (patch)
treec606d55b9bafcdcd2d9530a6fd0d21ec3f55236a
parentda33321e5c5cd5adce81b61140b9d8697cfbf7b9 (diff)
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 <matt.ranostay@konsulko.com>
-rw-r--r--binding/afm-gps-binding.c8
1 files 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);
}