From 0899486378f35c5fe6fc6469327a5d218f696ecd Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 15 Apr 2016 13:59:53 +0200 Subject: [PATCH] Add support for the new DX data format. Just like the D4i and D6i, the new header is a few bytes larger. The correct variant can again be detected by means of the logbook id tag at the start of the header. --- src/suunto_d9_parser.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/suunto_d9_parser.c b/src/suunto_d9_parser.c index 843652f..f534051 100644 --- a/src/suunto_d9_parser.c +++ b/src/suunto_d9_parser.c @@ -53,6 +53,8 @@ #define ID_D6I_V2 0x18724062 #define ID_D4I_V1 ID_D6I_V1_MIX2 #define ID_D4I_V2 ID_D6I_V2 +#define ID_DX_V1 0x18922062 +#define ID_DX_V2 0x18924062 #define AIR 0 #define NITROX 1 @@ -160,7 +162,10 @@ suunto_d9_parser_cache (suunto_d9_parser_t *parser) gasmix_count = 8; } else if (parser->model == DX) { gasmode_offset = 0x21; - gasmix_offset = 0xC1; + if (id == ID_DX_V2) + gasmix_offset = 0xC3; + else + gasmix_offset = 0xC1; gasmix_count = 11; }