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.
This commit is contained in:
Jef Driesen 2015-05-05 20:23:47 +02:00
parent 23acddbe08
commit 02e812f88b

View File

@ -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);
}
}
}