From 69d26e00b09a0cc0e62194d8d0081c536f8989db Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 21 Jul 2016 09:17:34 +0900 Subject: [PATCH] Suunto EON Steel: add desaturation time reporting The EON Steel reports it in seconds remaining after the dive. That's a bit excessive, but I guess SI units is where it's at. Signed-off-by: Linus Torvalds Signed-off-by: Dirk Hohndel --- src/suunto_eonsteel_parser.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/suunto_eonsteel_parser.c b/src/suunto_eonsteel_parser.c index c70edc8..377a3c0 100644 --- a/src/suunto_eonsteel_parser.c +++ b/src/suunto_eonsteel_parser.c @@ -1344,6 +1344,16 @@ static int traverse_diving_fields(suunto_eonsteel_parser_t *eon, const struct ty return 0; } + if (!strcmp(name, "DesaturationTime")) { + char desat[16]; + unsigned int time = array_uint32_le(data); // In seconds! + + // Let's just agree to ignore seconds + time /= 60; + snprintf(desat, sizeof(desat), "%d:%02d", time / 60, time % 60); + return add_string(eon, "Desaturation Time", desat); + } + return 0; }