[PATCH 2/2] EON Steel: expose the gas switch cylinder in the "flags" field

Linus Torvalds torvalds at linux-foundation.org
Sat Jan 3 17:32:36 PST 2015


From: Linus Torvalds <torvalds at linux-foundation.org>
Date: Sat, 3 Jan 2015 17:09:45 -0800
Subject: [PATCH 2/2] EON Steel: expose the gas switch cylinder in the "flags" field

This seems to be the simplest extension to the SAMPLE_EVENT_GASCHANGE2
format: the "value" remains the oddly encoded gas mix, but the "flags"
value (if non-zero) now contains the actual cylinder number we switch
to.

This will need a trivial patch to subsurface to take advantage of the
new data too.  But then we can actually distinguish between cylinders
that have the same gas mix.

Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
---

Hey, it sure is simple. 

 src/suunto_eonsteel_parser.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/suunto_eonsteel_parser.c b/src/suunto_eonsteel_parser.c
index 6296b2642ba0..40e3feb02a35 100644
--- a/src/suunto_eonsteel_parser.c
+++ b/src/suunto_eonsteel_parser.c
@@ -325,6 +325,7 @@ static void sample_gas_switch_event(struct sample_data *info, unsigned short idx
 
 	sample.event.type = SAMPLE_EVENT_GASCHANGE2;
 	sample.event.value = o2 | (he << 16);
+	sample.event.flags = idx;
 
 	if (info->callback) info->callback(DC_SAMPLE_EVENT, sample, info->userdata);
 }
-- 
2.2.1.212.gc5b9256



More information about the devel mailing list