diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-24 10:07:50 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-24 10:07:50 +1300 |
commit | 26a22bfb11e7e71ce06628ee397eb06b2a66d231 (patch) | |
tree | ecac0be808b5df29b98d713882d1d1f06848bb85 | |
parent | 540b90285d3493a10cb95d72196a4afe4b4acb5d (diff) | |
download | trackermap-server-26a22bfb11e7e71ce06628ee397eb06b2a66d231.tar.gz trackermap-server-26a22bfb11e7e71ce06628ee397eb06b2a66d231.tar.bz2 trackermap-server-26a22bfb11e7e71ce06628ee397eb06b2a66d231.zip |
Handle positive coordinates sign
-rw-r--r-- | src/org/traccar/protocol/C2stekProtocolDecoder.java | 4 | ||||
-rw-r--r-- | test/org/traccar/protocol/C2stekProtocolDecoderTest.java | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/C2stekProtocolDecoder.java b/src/org/traccar/protocol/C2stekProtocolDecoder.java index fd99990ce..6a31cb2f4 100644 --- a/src/org/traccar/protocol/C2stekProtocolDecoder.java +++ b/src/org/traccar/protocol/C2stekProtocolDecoder.java @@ -42,8 +42,8 @@ public class C2stekProtocolDecoder extends BaseProtocolDecoder { .number("(dd)(dd)(dd)#") // date (yymmdd) .number("(dd)(dd)(dd)#") // time (hhmmss) .number("([01])#") // valid - .number("(-?d+.d+)#") // latitude - .number("(-?d+.d+)#") // longitude + .number("([+-]?d+.d+)#") // latitude + .number("([+-]?d+.d+)#") // longitude .number("(d+.d+)#") // speed .number("(d+.d+)#") // course .number("(-?d+.d+)#") // altitude diff --git a/test/org/traccar/protocol/C2stekProtocolDecoderTest.java b/test/org/traccar/protocol/C2stekProtocolDecoderTest.java index 0a5690f76..9f841fb8c 100644 --- a/test/org/traccar/protocol/C2stekProtocolDecoderTest.java +++ b/test/org/traccar/protocol/C2stekProtocolDecoderTest.java @@ -10,6 +10,9 @@ public class C2stekProtocolDecoderTest extends ProtocolTest { C2stekProtocolDecoder decoder = new C2stekProtocolDecoder(null); + verifyNull(decoder, text( + "PA$863083038046613$D#181123#162850#1#+37.92684#+23.75933#0.62#200.1#0.0#3768#000#9#00#sz-w1001#B0907839$AP")); + verifyPosition(decoder, text( "PA$353990030327618$D#091117#020928#1#22.537222#114.020948#0.00#0.0#42.1#4183#011#1#101#Wsz-wl001#B0101940#C+3.0,-5.0,+2.0$AP")); |