diff options
-rw-r--r-- | src/org/traccar/protocol/Tr20ProtocolDecoder.java | 2 | ||||
-rw-r--r-- | test/org/traccar/protocol/Tr20ProtocolDecoderTest.java | 3 |
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")); |