aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/VisiontekProtocolDecoderTest.java
blob: ad637256e06ff7d912ae6c1ddef49ce9152dc4c8 (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.ProtocolDecoderTest;

public class VisiontekProtocolDecoderTest extends ProtocolDecoderTest {

    @Test
    public void testDecode() throws Exception {

        VisiontekProtocolDecoder decoder = new VisiontekProtocolDecoder(new VisiontekProtocol());
        
        //verifyPosition(decoder, text(
        //        "$1,AP116,05,06,15,11,48,32,1725.0460N,07824.5289E,0617,07,0,030,2091,0,0,0,1,1,1,1,20,00.0000,00.3820,00.0000,VAJRA V1.00,A#"));

        verifyPosition(decoder, text(
                "$1,AP09BU9397,861785006462448,20,06,14,15,03,28,17267339N,078279407E,060.0,073,0550,11,0,1,0,0,1,1,26,A,0000000000"));

        verifyNothing(decoder, text(
                "$1,AP09BU9397,861785006462448,20,06,14,15,03,28,000000000,0000000000,000.0,000,0000,00,0,1,0,0,1,1,24,V,0000000000"));
        
        verifyNothing(decoder, text(
                "$1,1234567890,02,06,11,17,07,45,00000000,000000000,00.0,0,0,V"));

        verifyPosition(decoder, text(
                "$1,1234567890,02,06,11,17,07,45,17267690N,078279340E,060.0,113,0,A"));

    }

}