diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-20 10:10:59 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-20 10:10:59 +1200 |
commit | 8e4d44e045c6e0c800b3b353f6f55c64d731428c (patch) | |
tree | f4aaca0b2103b7437cd1113385c88656689e34ff | |
parent | d98cd05a989bd0cd3f6dd4c581e46b0cbbd6424a (diff) | |
download | traccar-server-8e4d44e045c6e0c800b3b353f6f55c64d731428c.tar.gz traccar-server-8e4d44e045c6e0c800b3b353f6f55c64d731428c.tar.bz2 traccar-server-8e4d44e045c6e0c800b3b353f6f55c64d731428c.zip |
Adjust TK103 voltage values
-rw-r--r-- | src/org/traccar/protocol/Tk103ProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/Tk103ProtocolDecoderTest.java | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java index a0998d50d..a76c208b5 100644 --- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java +++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java @@ -118,12 +118,12 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder { int battery = parser.nextInt(); if (battery != 65535) { - position.set(Position.KEY_BATTERY, battery); + position.set(Position.KEY_BATTERY, battery * 0.01); } int power = parser.nextInt(); if (power != 65535) { - position.set(Position.KEY_POWER, power); + position.set(Position.KEY_POWER, power * 0.1); } return position; diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java index bd54a4ade..b15d7894e 100644 --- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java @@ -23,7 +23,7 @@ public class Tk103ProtocolDecoderTest extends ProtocolTest { "(088047194605BZ00,510,010,36e6,932c,43,36e6,766b,36,36e6,7668,32")); verifyAttributes(decoder, text( - "(013632651491,ZC20,040613,040137,6,42,112,0")); + "(013632651491,ZC20,040613,040137,6,421,112,0")); verifyAttributes(decoder, text( "(864768010159785,ZC20,291015,030413,3,362,65535,255")); |