[PATCH 2/8] Fixed bug with water_conductivity.
John Van Ostrand
john at vanostrand.com
Sun Nov 2 18:52:28 PST 2014
It seems some DCs use that byte for other things too. Masking
bits 0-1 fix this.
---
src/cochran_emc_parser.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cochran_emc_parser.c b/src/cochran_emc_parser.c
index f336e43..5b1ce93 100644
--- a/src/cochran_emc_parser.c
+++ b/src/cochran_emc_parser.c
@@ -107,7 +107,7 @@ cochran_emc_parser_get_field (dc_parser_t *abstract, dc_field_type_t type,
// 0 = low conductivity, 2 = high, maybe there's a 1?
water->type = ( log[EMC_WATER_CONDUCTIVITY] == 0 ? DC_WATER_FRESH
: DC_WATER_SALT );
- water->density = 1000 + 12.5 * log[EMC_WATER_CONDUCTIVITY];
+ water->density = 1000 + 12.5 * (log[EMC_WATER_CONDUCTIVITY] & 0x3);
break;
case DC_FIELD_ATMOSPHERIC:
*(double *) value = ATM / BAR * pow(1 - 0.0000225577
--
1.8.3.1
More information about the devel
mailing list