aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-19 10:10:34 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-19 10:10:34 +1200
commit576ce5efbf2da92b843fcb2edf9b948be41cc99a (patch)
treedd9c34bf13d7f6936d9fe90b9aba67c0b7fc8413
parent0554e13bb8de191c24c6c1c3b6957b34df3a9fe5 (diff)
downloadtrackermap-server-576ce5efbf2da92b843fcb2edf9b948be41cc99a.tar.gz
trackermap-server-576ce5efbf2da92b843fcb2edf9b948be41cc99a.tar.bz2
trackermap-server-576ce5efbf2da92b843fcb2edf9b948be41cc99a.zip
Fix an issue in TK103 decoder
-rw-r--r--src/org/traccar/protocol/Tk103ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Tk103ProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tk103ProtocolDecoder.java b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
index 36378d088..a22eaa4ba 100644
--- a/src/org/traccar/protocol/Tk103ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tk103ProtocolDecoder.java
@@ -121,7 +121,7 @@ public class Tk103ProtocolDecoder extends BaseProtocolDecoder {
int power = parser.nextInt();
if (power != 65535) {
- position.set(Position.KEY_POWER, battery);
+ position.set(Position.KEY_POWER, power);
}
return position;
diff --git a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
index b64f1ae26..bd54a4ade 100644
--- a/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Tk103ProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class Tk103ProtocolDecoderTest extends ProtocolTest {
Tk103ProtocolDecoder decoder = new Tk103ProtocolDecoder(new Tk103Protocol());
verifyAttributes(decoder, text(
+ "(013632651491,ZC20,180716,144222,6,392,65535,255"));
+
+ verifyAttributes(decoder, text(
"(087072009461BR00000007V0000.0000N00000.0000E000.00014039900000000L00000000"));
verifyPosition(decoder, text(