From e99b8ac8371b3ef324e124a5c6c4ee88eeae800d Mon Sep 17 00:00:00 2001 From: Janice Date: Sun, 31 Jul 2016 09:44:43 -0700 Subject: [PATCH] Add NDL and RBT for the ATOM31 and I450T --- src/oceanic_atom2_parser.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/oceanic_atom2_parser.c b/src/oceanic_atom2_parser.c index d3b1c20..951f336 100644 --- a/src/oceanic_atom2_parser.c +++ b/src/oceanic_atom2_parser.c @@ -852,6 +852,10 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_ decostop = data[offset + 10]; decotime = array_uint16_le(data + offset + 6); have_deco = 1; + } else if (parser->model == ATOM31) { + decostop = (data[offset + 5] & 0xF0) >> 4; + decotime = array_uint16_le(data + offset + 4) & 0x03FF; + have_deco = 1; } if (have_deco) { if (decostop) { @@ -865,6 +869,20 @@ oceanic_atom2_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_ if (callback) callback (DC_SAMPLE_DECO, sample, userdata); } + unsigned int have_rbt = 0; + unsigned int rbt = 0; + if (parser->model == ATOM31) { + rbt = array_uint16_le(data + offset + 6) & 0x01FF; + have_rbt = 1; + } else if (parser->model == I450T) { + rbt = array_uint16_le(data + offset + 8) & 0x01FF; + have_rbt = 1; + } + if (have_rbt) { + sample.rbt = rbt; + if (callback) callback (DC_SAMPLE_RBT, sample, userdata); + } + complete = 1; }