From fd8b88891ff2670f801afad46015870078dc2c56 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Thu, 3 Nov 2011 20:25:15 +0100 Subject: [PATCH] Add support for the pressure samples. --- src/mares_iconhd_parser.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mares_iconhd_parser.c b/src/mares_iconhd_parser.c index 49840b2..181705a 100644 --- a/src/mares_iconhd_parser.c +++ b/src/mares_iconhd_parser.c @@ -240,6 +240,13 @@ mares_iconhd_parser_samples_foreach (parser_t *abstract, sample_callback_t callb if (parser->model == ICONHDNET && (nsamples % 4) == 0) { if (offset + 8 > size) return PARSER_STATUS_ERROR; + + // Pressure (1/100 bar). + unsigned int pressure = array_uint16_le(data + offset); + sample.pressure.tank = 0; + sample.pressure.value = pressure / 100.0; + if (callback) callback (SAMPLE_TYPE_PRESSURE, sample, userdata); + offset += 8; } }