From 02e812f88b196620a67834aa1b58c0c4a94abc17 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Tue, 5 May 2015 20:23:47 +0200 Subject: [PATCH] Apply the ghost event fix for the Suunto Solution. I forgot to include the Suunto Solution part in the previous commit. In theory the Suunto Solution (and Eon) can't be affected by the ghost event bug. All possible events bytes are already exhausted, and therefore unknown events are impossible. But applying the fix anyway doesn't hurt and keeps the code consistent with the other backends. --- src/suunto_solution_parser.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/suunto_solution_parser.c b/src/suunto_solution_parser.c index 0d9e978..94e146a 100644 --- a/src/suunto_solution_parser.c +++ b/src/suunto_solution_parser.c @@ -206,6 +206,7 @@ suunto_solution_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callbac if (callback) callback (DC_SAMPLE_DEPTH, sample, userdata); } else { // Event. + sample.event.type = SAMPLE_EVENT_NONE; sample.event.time = 0; sample.event.flags = 0; sample.event.value = 0; @@ -224,7 +225,9 @@ suunto_solution_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callbac break; } - if (callback) callback (DC_SAMPLE_EVENT, sample, userdata); + if (sample.event.type != SAMPLE_EVENT_NONE) { + if (callback) callback (DC_SAMPLE_EVENT, sample, userdata); + } } }