aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-02-09 12:35:05 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-02-09 12:35:05 -0800
commitebfc5667699d63c480b7eed87f4869b29dbae744 (patch)
treee7c2176ede7161ff9cd119227e082bdc3eca9565
parent88fd0903f101cca7d86e2bd78fe02bbacbd7b6fb (diff)
downloadtraccar-server-ebfc5667699d63c480b7eed87f4869b29dbae744.tar.gz
traccar-server-ebfc5667699d63c480b7eed87f4869b29dbae744.tar.bz2
traccar-server-ebfc5667699d63c480b7eed87f4869b29dbae744.zip
Fix temperature decoding
-rw-r--r--src/org/traccar/protocol/EelinkProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/EelinkProtocolDecoderTest.java4
2 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java
index 14bf44fbf..fce176ec5 100644
--- a/src/org/traccar/protocol/EelinkProtocolDecoder.java
+++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java
@@ -268,7 +268,7 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
}
if (buf.readableBytes() >= 2) {
- position.set(Position.PREFIX_TEMP + 2, buf.readUnsignedShort() / 16.0);
+ position.set(Position.PREFIX_TEMP + 2, buf.readShort() / 16.0);
}
}
diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java
index 3e2a896f7..f8a16c46f 100644
--- a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java
@@ -15,6 +15,10 @@ public class EelinkProtocolDecoderTest extends ProtocolTest {
"454C0027E753035254407167747167670100180002035254407167747100200205020500010432000086BD"));
verifyAttribute(decoder, binary(
+ "676712003400e45c5b0ade02012e03702d87064546aa24066a1086018a0000002dc1a0ffffffff0afd074d000000000000000000000000fce0"),
+ Position.PREFIX_TEMP + 2, -50.0);
+
+ verifyAttribute(decoder, binary(
"6767120043000e5c37387c0304e4e1b4f8194fa800160013009408012e03702d8706453c6e5b066f115f05710000001b067f8d248d240313020500000000000000000000000001cc"),
Position.PREFIX_TEMP + 2, 28.75);