aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-02-02 00:35:53 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-02-02 00:35:53 -0800
commitc0b737b3a8b3a5bb2a383e14d3ae5c14a5260781 (patch)
tree437da14f609a08c5ee3cfdb5e26d6fa78582fc22
parent9d9778d13be1cef31c7891fc9519edfa54efdc2a (diff)
downloadtrackermap-server-c0b737b3a8b3a5bb2a383e14d3ae5c14a5260781.tar.gz
trackermap-server-c0b737b3a8b3a5bb2a383e14d3ae5c14a5260781.tar.bz2
trackermap-server-c0b737b3a8b3a5bb2a383e14d3ae5c14a5260781.zip
Fix TR20 decoder
-rw-r--r--src/org/traccar/protocol/Tr20ProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/Tr20ProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/Tr20ProtocolDecoder.java b/src/org/traccar/protocol/Tr20ProtocolDecoder.java
index 6c7b689a6..c2e6c381f 100644
--- a/src/org/traccar/protocol/Tr20ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Tr20ProtocolDecoder.java
@@ -52,7 +52,7 @@ public class Tr20ProtocolDecoder extends BaseProtocolDecoder {
.number("(ddd)(dd.d+),") // longitude
.number("(d+),") // speed
.number("(d+),") // course
- .number("(?:NA|[FC](-?d+)),") // temperature
+ .number("(?:NA|[FC]?(-?d+)),") // temperature
.number("(x{8}),") // status
.number("(d+)") // event
.any()
diff --git a/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java b/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java
index d43031e06..76355066b 100644
--- a/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Tr20ProtocolDecoderTest.java
@@ -10,6 +10,9 @@ public class Tr20ProtocolDecoderTest extends ProtocolTest {
Tr20ProtocolDecoder decoder = new Tr20ProtocolDecoder(null);
+ verifyPosition(decoder, text(
+ "%%123456789012345,A,120101121800,N6000.0000E13000.0000,0,000,0,01034802,150,[Message]"));
+
verifyNull(decoder, text(
"%%TRACKPRO01,1"));