diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-01-12 02:07:56 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-01-12 01:07:56 +1300 |
commit | e54122e22725bae7a962d58e06a497526aed46cb (patch) | |
tree | 2a69b6f039103564252ebf42df618353898e681f /test/org | |
parent | afa6bfcef49c7152b3292010f43075356b9c9727 (diff) | |
download | trackermap-server-e54122e22725bae7a962d58e06a497526aed46cb.tar.gz trackermap-server-e54122e22725bae7a962d58e06a497526aed46cb.tar.bz2 trackermap-server-e54122e22725bae7a962d58e06a497526aed46cb.zip |
Better handle H02 X mode (fix #2780)
Diffstat (limited to 'test/org')
-rw-r--r-- | test/org/traccar/protocol/H02FrameDecoderTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/H02FrameDecoderTest.java b/test/org/traccar/protocol/H02FrameDecoderTest.java index 7d54299a5..1505e25ac 100644 --- a/test/org/traccar/protocol/H02FrameDecoderTest.java +++ b/test/org/traccar/protocol/H02FrameDecoderTest.java @@ -40,4 +40,27 @@ public class H02FrameDecoderTest extends ProtocolTest { } + @Test + public void testDecodeAlternative() throws Exception { + + H02FrameDecoder decoder = new H02FrameDecoder(0); + + Assert.assertEquals( + binary("2a48512c343230363131393133302c4e42522c3130323430332c3233382c312c302c372c313131312c323236342c36332c313131312c323236352c35382c313131312c323236362c35302c313131312c333133352c33372c313131312c3630352c33332c313131312c343932302c33302c313131312c3630372c32382c3131303131372c46464646444646462c3623"), + decoder.decode(null, null, binary("2a48512c343230363131393133302c4e42522c3130323430332c3233382c312c302c372c313131312c323236342c36332c313131312c323236352c35382c313131312c323236362c35302c313131312c333133352c33372c313131312c3630352c33332c313131312c343932302c33302c313131312c3630372c32382c3131303131372c46464646444646462c3623"))); + + Assert.assertEquals( + binary("2442061191301024031101175540227006012321670c000095fffffbffff001f00000001f800ee010000000032"), + decoder.decode(null, null, binary("2442061191301024031101175540227006012321670c000095fffffbffff001f00000001f800ee010000000032"))); + + Assert.assertEquals( + binary("5800009814991024031101175540227006012321670c000095fffffbffff0033"), + decoder.decode(null, null, binary("5800009814991024031101175540227006012321670c000095fffffbffff0033"))); + + Assert.assertEquals( + binary("2a48512c343230363131393133302c4e42522c3130323431362c3233382c312c302c372c313131312c323236342c35332c313131312c323236352c36302c313131312c323236362c34342c313131312c333133352c34332c313131312c3630352c33392c313131312c343932302c32392c313131312c3630372c32342c3131303131372c46464646464246462c3623"), + decoder.decode(null, null, binary("2a48512c343230363131393133302c4e42522c3130323431362c3233382c312c302c372c313131312c323236342c35332c313131312c323236352c36302c313131312c323236362c34342c313131312c333133352c34332c313131312c3630352c33392c313131312c343932302c32392c313131312c3630372c32342c3131303131372c46464646464246462c3623"))); + + } + } |