diff options
Diffstat (limited to 'test/org/traccar/protocol')
4 files changed, 110 insertions, 5 deletions
diff --git a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java index 26844994e..cb39b5d2e 100644 --- a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java @@ -10,6 +10,24 @@ public class AplicomProtocolDecoderTest extends ProtocolTest { AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(new AplicomProtocol());
+ verifyAttributes(decoder, binary(
+ "48C1014143B4493145004900203F6D014B5557C20003000015060110FF00C800000000000000003D01141E283C500100260404010200000000000000000000000000C8000000000000010200110019001E0064019003E8"));
+
+ verifyAttributes(decoder, binary(
+ "48c10144b9de54e6b2008700205f710a57d23ec957d23b8d00000000300d0106ff00000000000000000000000000000000000000000000000000000000000000010a141e28323c46505a646e7801000f020104ff000000000000000000010102000f020104ff000000000000000000010103000f020104ff000000000000000000010105000f020104ff0000000000000000000101"));
+
+ verifyAttributes(decoder, binary(
+ "45c20145931876ffb2007100ffff6d00000057c6dd1970230d087b1f7d7f0000d0c1000000003580000035801f40ffff5001574442393036363035533132333435363700014142432d333435202020202020000000000000000000000000000000000000000000000001123130343632343639373030303030303100000000"));
+
+ verifyAttributes(decoder, binary(
+ "45c20145931876ffb2007100ffff6d00000057c6dd9170250d087b1f7d7f0000d0c1000000003580000035801f40ffff5001574442393036363035533132333435363700014142432d333435202020202020000000000000000000000000000000000000000000000001123130343632343639373030303030303100000000"));
+
+ verifyAttributes(decoder, binary(
+ "45c20145931876ffb2007100ffff6d00000057c6de0970270d087b1f7d7f0000d0c1000000003580000035801f40ffff5001574442393036363035533132333435363700014142432d333435202020202020000000000000000000000000000000000000000000000001123130343632343639373030303030303100000000"));
+
+ verifyAttributes(decoder, binary(
+ "44c3014645e8ecff3c00ea03ffffbc00f457d68a6557d68a6303bb55fa018843da1100009881000000000000000000000000000000000000000000000000000000000000000000000000000000ff0056007600000000000000014542016d0001010095070e14014645e8ecff3c57d68a6403bb55fa018843dac0010d14ff050102030405060708090a0b0c0d0e0f10112a01010730343f3c1ff5cf01020700007d007d23010103022f2e01060c67452301efcdab8967452301010b10000000007d007d007d7dffffffffffff010a2400000000000000010000000000000000ffffffffffffffff00010001ffff00000000ffff010c02fec6"));
+
verifyPosition(decoder, binary(
"44c3014645e8e91b66002300a21f0b01f056d3e62856d3e626031f845f00c6ee440800000000000000000017bd1cb30000"));
@@ -19,7 +37,7 @@ public class AplicomProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, binary(
"44c3014645e8e91b66001f00221f0b01f456ba1e0d56ba1e0b031f842200c6ef550c000000000017bd1cb30004"));
- verifyNothing(decoder, binary(
+ verifyAttributes(decoder, binary(
"44c3014645e8e9bada003e03fff7070055a4f24200000081000000000000000000000000000000000000000000000000000000000000000000000000000000ff00000001000000000000000044c3014645e8e9bada003e03fff77bff55a4f24300000081000000000000000000000000000000000000000000000000000000000000000000000000000000ff00300002000000000000000044c3014645e8e9bada003e03fff7690655a4f24500000081000000000000000000000000000000000000000000000000000000000000000000000000000000ff003000030000000000000000"));
verifyPosition(decoder, binary(
diff --git a/test/org/traccar/protocol/CguardProtocolDecoderTest.java b/test/org/traccar/protocol/CguardProtocolDecoderTest.java new file mode 100644 index 000000000..49d037f8f --- /dev/null +++ b/test/org/traccar/protocol/CguardProtocolDecoderTest.java @@ -0,0 +1,54 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class CguardProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + CguardProtocolDecoder decoder = new CguardProtocolDecoder(new CguardProtocol()); + + verifyNothing(decoder, text( + "IDRO:354868050655283")); + + verifyPosition(decoder, text( + "NV:160711 044023:54.342907:48.582590:0:NAN:0:110.1")); + + verifyPosition(decoder, text( + "NV:160711 044023:54.342907:-148.582590:0:NAN:0:110.1")); + + verifyNothing(decoder, text( + "BC:160711 044023:CSQ1:48:NSQ1:7:NSQ2:1:BAT1:98:PWR1:11.7:CLG1:NAN")); + + verifyNothing(decoder, text( + "BC:160711 044524:CSQ1:61:NSQ1:18:BAT1:98:PWR1:11.7:CLG1:NAN")); + + verifyNothing(decoder, text( + "VERSION:3.3")); + + verifyPosition(decoder, text( + "NV:160420 101902:55.799425:37.674033:0.94:NAN:213.59:156.6")); + + verifyNothing(decoder, text( + "BC:160628 081024:CSQ1:32:NSQ1:10:BAT1:100")); + + verifyNothing(decoder, text( + "BC:160628 081033:NSQ2:0")); + + verifyPosition(decoder, text( + "NV:160630 151537:55.799913:37.674267:0.7:NAN:10.21:174.9")); + + verifyNothing(decoder, text( + "BC:160630 153316:BAT1:76")); + + verifyNothing(decoder, text( + "BC:160630 153543:NSQ2:0")); + + verifyNothing(decoder, text( + "PING")); + + } + +} diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index b95d8ddce..4bbfb5627 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -11,6 +11,36 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(new Jt600Protocol()); + verifyPosition(decoder, buffer( + "(3301210003,U01,040812,185302,T,22.564025,N,113.242329,E,5.21,152,9,32%,00000000000011,10133,5173,22,100,1)")); + + verifyPosition(decoder, buffer( + "(3301210003,U02,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1)")); + + verifyPosition(decoder, buffer( + "(3301210003,U03,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,00000000000011,10133,5173,22,100,1)")); + + verifyNothing(decoder, buffer( + "(3301210003,U04)")); + + verifyPosition(decoder, buffer( + "(3301210003,U06,1,040812,185302,T,22.564025,N,113.242329,E,5,152,9,32%,0000000000011,10133,5173,22,100,1,300,100,10)")); + + verifyPosition(decoder, buffer( + "(3460311327,U01,220916,135251,T,9.552607,N,13.658292,W,0.31,0,9,0%,00001001000000,11012,10,27,0,0,33)")); + + verifyPosition(decoder, buffer( + "(3460311327,U01,010100,000024,F,0.000000,N,0.000000,E,0.00,0,0,100%,00000001000000,263,1,18,0,0,33)")); + + verifyNothing(decoder, buffer( + "(3460311327,@JT)")); + + verifyPosition(decoder, buffer( + "(3460311327,U06,11,220916,135643,T,9.552553,N,13.658265,W,0.61,0,9,100%,00000001000000,11012,10,30,0,0,126,0,30)")); + + verifyPosition(decoder, buffer( + "(3460311327,U06,10,220916,140619,T,9.552495,N,13.658227,W,0.43,0,7,0%,00101001000000,11012,10,0,0,0,126,0,30)")); + verifyPosition(decoder, binary( "24311021600111001B16021105591022329862114046227B0598095080012327951435161F"), position("2011-02-16 05:59:10.000", true, 22.54977, -114.07705)); @@ -31,11 +61,11 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, buffer( "(3120820029,W01,02553.3555,E,2438.0997,S,A,171012,053339,0,8,20,6,31,5,20,20)")); - /*verifyPosition(decoder, text( ChannelBuffers.copiedBuffer( - "(3330104377,U01,010100,010228,F,00.000000,N,000.000000,E,0,0,0,0%,00001000000000,741,14,22,0,206)", StandardCharsets.US_ASCII))); + verifyPosition(decoder, buffer( + "(3330104377,U01,010100,010228,F,00.000000,N,000.000000,E,0,0,0,0%,00001000000000,741,14,22,0,206)")); - verifyPosition(decoder, text( ChannelBuffers.copiedBuffer( - "(6221107674,2,U09,129,2,A,280513113036,E,02711.0500,S,1721.0876,A,030613171243,E,02756.7618,S,2300.0325,3491,538200,14400,1)",StandardCharsets.US_ASCII))));*/ + verifyNothing(decoder, buffer( + "(6221107674,2,U09,129,2,A,280513113036,E,02711.0500,S,1721.0876,A,030613171243,E,02756.7618,S,2300.0325,3491,538200,14400,1)")); } diff --git a/test/org/traccar/protocol/OigoProtocolDecoderTest.java b/test/org/traccar/protocol/OigoProtocolDecoderTest.java index b75f3162b..14c34ae7c 100644 --- a/test/org/traccar/protocol/OigoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/OigoProtocolDecoderTest.java @@ -16,6 +16,9 @@ public class OigoProtocolDecoderTest extends ProtocolTest { verifyPosition(decoder, binary( "7e004200000014631000258257000000ffff02d1690e00051f690e00051f0696dbd204bdfde31a070000b307100f35c0106305f500000000010908010402200104ffff8001")); + verifyPosition(decoder, binary( + "7e004200000014631000258257000000ffff0d82691300001669130000160696dbd804bdfdbb1a0800000007101035a2106905f500000000010908010402200104ffff8001")); + } } |