aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java
blob: 788830e5265042c3ffa0ddb4a54e0f01aa544c7a (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
31
32
33
34
35
36
37
38
39
40
41
42
43
package org.traccar.protocol;

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

public class GpsGateProtocolDecoderTest extends ProtocolTest {

    @Test
    public void testDecode() throws Exception {

        GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(new GpsGateProtocol());

        verifyNothing(decoder, text(
                "$FRCMD,862950025974620,_Ping,voltage=4*4F"));

        verifyPosition(decoder, text(
                "$FRCMD,862950025974620,_SendMessage, ,2721.5781,S,15259.145,E,61,0.00,61,080316,092612,1,SosButton=0,voltage=4*60"));

        verifyNothing(decoder, text(
                "$FRLIN,,user1,8IVHF*7A"));
        
        verifyNothing(decoder, text(
                "$FRLIN,,354503026292842,VGZTHKT*0C"));

        verifyNothing(decoder, text(
                "$FRLIN,IMEI,1234123412341234,*7B"));
        
        verifyNothing(decoder, text(
                "$FRLIN,,saab93_device,KLRFBGIVDJ*28"));

        verifyPosition(decoder, text(
                "$GPRMC,154403.000,A,6311.64120,N,01438.02740,E,0.000,0.0,270707,,*0A"),
                position("2007-07-27 15:44:03.000", true, 63.19402, 14.63379));

        verifyPosition(decoder, text(
                "$GPRMC,074524,A,5553.73701,N,03728.90491,E,10.39,226.5,160614,0.0,E*75"));

        verifyPosition(decoder, text(
                "$GPRMC,154403.000,A,6311.64120,N,01438.02740,E,0.000,0.0,270707,,*0A"));

    }

}