diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-01-31 22:46:39 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-31 22:46:39 -0800 |
commit | 46d3fe1130fe6963a2e0480c6033cfc5d36514bf (patch) | |
tree | 0775e2f84c6b50917288bb43e3225613781a42ab /test/org/traccar/protocol/NavisFrameDecoderTest.java | |
parent | 2b2fef08daaa7950a4911aef184f4dca56500da1 (diff) | |
parent | a3c540a952b5136b1de2900c8947847f70b39446 (diff) | |
download | trackermap-server-46d3fe1130fe6963a2e0480c6033cfc5d36514bf.tar.gz trackermap-server-46d3fe1130fe6963a2e0480c6033cfc5d36514bf.tar.bz2 trackermap-server-46d3fe1130fe6963a2e0480c6033cfc5d36514bf.zip |
Merge pull request #4201 from iEvgeny/navis-flex
Implemented FLEX 1.0/2.0 extension support for Navis (NTCB) protocol
Diffstat (limited to 'test/org/traccar/protocol/NavisFrameDecoderTest.java')
-rw-r--r-- | test/org/traccar/protocol/NavisFrameDecoderTest.java | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/NavisFrameDecoderTest.java b/test/org/traccar/protocol/NavisFrameDecoderTest.java new file mode 100644 index 000000000..0ebfeacd2 --- /dev/null +++ b/test/org/traccar/protocol/NavisFrameDecoderTest.java @@ -0,0 +1,36 @@ +package org.traccar.protocol; + +import org.traccar.ProtocolTest; + +import org.junit.Test; + +public class NavisFrameDecoderTest extends ProtocolTest { + + @Test + public void testDecodeNtcb() throws Exception { + + NavisFrameDecoder frameDecoder = new NavisFrameDecoder(); + + verifyFrame(binary( + "404e5443010000000000000059009adb2a3e54250000000000ff1500040b0a1008291838001200760ee600000000000000000000000f1500040b0a10ac20703fb1aec23f00000000320149668f430000000000000000000000000000000000000000000000f3808080"), + frameDecoder.decode(null, null, binary("404e5443010000000000000059009adb2a3e54250000000000ff1500040b0a1008291838001200760ee600000000000000000000000f1500040b0a10ac20703fb1aec23f00000000320149668f430000000000000000000000000000000000000000000000f3808080"))); + + } + + @Test + public void testDecodeFlex10() throws Exception { + + NavisFrameDecoder frameDecoder = new NavisFrameDecoder(); + + frameDecoder.setFlexDataSize(73); + + verifyFrame(binary( + "7e54040000000400000030129957405c000b00632f9857405ccace03021e129101a103000000000000c4005ba3fe3b00000000120046100000000000001aff7f000080bfffff80000080bfffffffff9f"), + frameDecoder.decode(null, null, binary("7e54040000000400000030129957405c000b00632f9857405ccace03021e129101a103000000000000c4005ba3fe3b00000000120046100000000000001aff7f000080bfffff80000080bfffffffff9f"))); + + verifyFrame(binary( + "7e4101080000000917c057405c002b001833c057405cbbce030225129101a00300007c6102408900400c1b3cfce3b23a12004710e000000000001bff7f000080bfffff80000080bfffffffffb2"), + frameDecoder.decode(null, null, binary("7e4101080000000917c057405c002b001833c057405cbbce030225129101a00300007c6102408900400c1b3cfce3b23a12004710e000000000001bff7f000080bfffff80000080bfffffffffb2"))); + } + +} |