aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/EgtsProtocolDecoderTest.java
blob: 7e5720b39f6dde5a4a88de584bf5fc6f617b7f04 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.traccar.protocol;

import org.junit.Test;
import org.traccar.ProtocolTest;

import java.nio.ByteOrder;

public class EgtsProtocolDecoderTest extends ProtocolTest {

    @Test
    public void testDecode() throws Exception {

        EgtsProtocolDecoder decoder = new EgtsProtocolDecoder(new EgtsProtocol());

        verifyNull(decoder, binary(ByteOrder.LITTLE_ENDIAN,
                "0100000b002400a0d601f01900030081030000000101011600030000004238363434393530333436343333373600014cdc"));

        verifyPositions(decoder, binary(ByteOrder.LITTLE_ENDIAN,
                "0100020B0025003A5701C91A003A5701CD6E68490202101700CBB4740F7617FD924364104F116A0000000000010300001EC2"),
                position("2018-03-21 05:38:19.000", true, 51.67569, 55.59189));

        verifyPositions(decoder, binary(ByteOrder.LITTLE_ENDIAN,
                "0100020B0079000000011F6A001424951CA5CB0F23B5740F020210180023B5740F0A301994DA9C524C9128000A000000100082000011040018110300120900000003150100E803001B0700010000340900001B0700420000000000001B0700430000000000001B0700440000000000001B0700450000000000001B0700460000000000008020"));

        verifyPositions(decoder, binary(ByteOrder.LITTLE_ENDIAN,
                "0100020B00F200000001D66A001224951CA5CB0FFCB4740F0202101800FCB4740F502119943D9F524C9119805C000000100084000011040018110300120900000003150100E803001B0700410000000000001B0700420000000000001B0700430000000000001B0700440000000000001B0700450000000000001B0700460000000000006A001324951CA5CB0F05B5740F020210180005B5740F222519942D9E524C9100008B000000100083000011040018110300120900000003160100E803001B0700010000310900001B0700420000000000001B0700430000000000001B0700440000000000001B0700450000000000001B070046000000000000134E"));

    }

}