diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-01-03 15:18:03 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-01-16 17:45:00 -0800 |
commit | fe5f15bdc53da12f1bed1a67e2f566746ba1d127 (patch) | |
tree | cbc791652067e2275218223af396bf783363ab14 /desktop-widgets | |
parent | 73641c4e73d8634eebe8fe00b96ba039da883b27 (diff) | |
download | subsurface-fe5f15bdc53da12f1bed1a67e2f566746ba1d127.tar.gz |
Add support for libdivecomputer using DC_SAMPLE_GASMIX
New libdivecomputer versions use DC_SAMPLE_GASMIX to indicate a gas
change (which contains the cylinder index we're changing to) rather than
SAMPLE_EVENT_GASCHANGE*.
Unlike the old GASCHANGE model, and despite the name, DC_SAMPLE_GASMIX
does not actually say what the mix is, it only specifies a cylinder
index. We had already extended SAMPLE_EVENT_GASCHANGE2 to have the
cylinder index in the otherwise unused "flags" field, so this is not all
that different from what we used to do.
And subsurface internally already had the logic that "if we know what
the cylinder index is, take the gas mix from the cylinder data", so
we've already been able to transparently use _either_ the actual gas mix
or the cylinder index to show the event.
But we do want to make it an event rather than some sample data, because
we want to show it as such in the profile. But because we are happy
with just the cylinder index, we'll just translate the DC_SAMPLE_GASMIX
thing to the SAMPLE_EVENT_GASCHANGE2 event, and nothing really changes
for subsurface.
libdivecomputer has made other changes, like indicating the initial
cylinder index with an early DC_SAMPLE_GASMIX report, but we've seen
that before too (in the form of early SAMPLE_EVENT_GASCHANGE events), so
that doesn't really end up changing anything for us either.
HOWEVER, one thing that is worth noticing: do *not* apply this patch and
then use an old libdivecomputer library that sends both the
DC_SAMPLE_GASMIX samples _and_ the deprecated SAMPLE_EVENT_GASCHANGE
events. It will all *work*, but since subsurface will take either,
you'll then get duplicate gas mix events.
It's not like that is in any way fatal, but it might be a bit confusing.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'desktop-widgets')
0 files changed, 0 insertions, 0 deletions