summaryrefslogtreecommitdiffstats
path: root/uemis.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-03 16:00:28 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-01-09 09:27:37 +0800
commita0a96e066421da202a3fcffabecfd8991bc6493d (patch)
tree4e922ac9b9c3b9d1a3bbf3fcb8137182156d0c3d /uemis.c
parent8795be53ae69e8d92633eff7e4ac9afccbaf1148 (diff)
downloadsubsurface-a0a96e066421da202a3fcffabecfd8991bc6493d.tar.gz
Fix Uemis temperature conversion
In commit 3fd39a7a87bf ("Remove some constants and use helpers instead") Anton missed the fact that the Uemis gives temperatures in the handy unit of "centi degree C". Now things work again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis.c')
-rw-r--r--uemis.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/uemis.c b/uemis.c
index e37de36ad..d869180eb 100644
--- a/uemis.c
+++ b/uemis.c
@@ -293,7 +293,7 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
datalen = uemis_convert_base64(base64, &data);
- dive->dc.airtemp.mkelvin = C_to_mkelvin(*(uint16_t *)(data + 45));
+ dive->dc.airtemp.mkelvin = C_to_mkelvin((*(uint16_t *)(data + 45)) / 10.0);
dive->dc.surface_pressure.mbar = *(uint16_t *)(data + 43);
if (*(uint8_t *)(data + 19))
dive->dc.salinity = SEAWATER_SALINITY; /* avg grams per 10l sea water */
@@ -351,7 +351,7 @@ void uemis_parse_divelog_binary(char *base64, void *datap) {
sample = prepare_sample(dc);
sample->time.seconds = u_sample->dive_time;
sample->depth.mm = rel_mbar_to_depth(u_sample->water_pressure, dive);
- sample->temperature.mkelvin = C_to_mkelvin(u_sample->dive_temperature);
+ sample->temperature.mkelvin = C_to_mkelvin(u_sample->dive_temperature / 10.0);
sample->sensor = active;
sample->cylinderpressure.mbar =
(u_sample->tank_pressure_high * 256 + u_sample->tank_pressure_low) * 10;