[PATCH 4/6] DLF import: Decode and import temperature

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


These decodings and constants makes the numbers line up perfectly with
the numbers presented on wetnotes.com.

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

diff --git a/parse-xml.c b/parse-xml.c
index 1f1b87e..77a62cc 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -2602,6 +2602,8 @@ int parse_dlf_buffer(unsigned char *buffer, size_t size)
 			cur_sample->ndl.seconds = ptr[8] * 60;
 			// Guessed unit here.. looks good.
 			cur_sample->tts.seconds = ((ptr[10] & 0x0F) << 4) + ptr[9] * 20;
+			cur_sample->temperature.mkelvin = (((ptr[11] & 0x0F) << 4) + (ptr[10] >> 4)) * 100 + ZERO_C_IN_MKELVIN;
+			// ptr[11] & 0xF0 is unknown, and always 0xC in all checked files
 			sample_end();
 			break;
 		case 1:
-- 
2.1.0



More information about the subsurface mailing list