[PATCH 2/6] DLF import: Decode ppO2

Anton Lundin glance at acc.umu.se
Mon Jan 5 13:59:18 PST 2015


This decodes the ppO2 value stored in the DLF files. It looks like the
DiveSoft Freedom computers always stores the ppO2 value, even for OC
dives.
This import only stores the ppO2 value from CCR and PSCR dives, where
these values comes from sensors and makes sense to store.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 parse-xml.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/parse-xml.c b/parse-xml.c
index 14ece90..cde6732 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -2591,6 +2591,11 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
 			sample_start();
 			cur_sample->time.seconds = time;
 			cur_sample->depth.mm = ((ptr[5] << 8) + ptr[4]) * 10;
+			// Crazy precision on these stored values...
+			// Only store value if we're in CCR/PSCR mode,
+			// because we rather calculate ppo2 our selfs.
+			if (cur_dc->dctype == CCR || cur_dc->dctype == PSCR)
+				cur_sample->o2sensor[0].mbar = ((ptr[7] << 8) + ptr[6]) / 10;
 			sample_end();
 			break;
 		case 1:
-- 
2.1.0



More information about the subsurface mailing list