From 5361bc06bdd37b4dbcd89edaa3d4dcaed93eefde Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Wed, 11 May 2016 10:49:15 +0200 Subject: [PATCH] Fix the nitrox gas mix parsing. Mares Darwin compatible devices support a nitrox mode. The nitrogen percentage should only be taken into account when the dive mode is set to nitrox, because the last used value remains in place for air dives. --- src/mares_darwin_parser.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mares_darwin_parser.c b/src/mares_darwin_parser.c index cad3d6b..d4d13da 100644 --- a/src/mares_darwin_parser.c +++ b/src/mares_darwin_parser.c @@ -156,7 +156,11 @@ mares_darwin_parser_get_field (dc_parser_t *abstract, dc_field_type_t type, unsi break; case DC_FIELD_GASMIX: gasmix->helium = 0.0; - gasmix->oxygen = 0.21; + if (mode == NITROX) { + gasmix->oxygen = p[0x0E] / 100.0; + } else { + gasmix->oxygen = 0.21; + } gasmix->nitrogen = 1.0 - gasmix->oxygen - gasmix->helium; break; case DC_FIELD_TEMPERATURE_MINIMUM: