1
2
3 '''
4 Run a water level message from NMEA to decoded
5 '''
6
7 import sys
8 from BitVector import BitVector
9 import binary
10 import ais_msg_8
11 import sls_header
12 import sls_waterlevel
13
14 if __name__=='__main__':
15 vdm='!AIVDM,1,1,4,A,8030ot1?0@>PSpPPPC<2<oURAU=>T08f@02PSpPPP3C3<oU=d5<U00BH@02PSpPPP3C3EoU:A5<TwPPO@02PSpPPP2hk<oRWU5;si0Pl@02O<0PPPP3D<oPPEU;M418g@02PSpPPP2hlEoRQgU;j@17p@00,2*32'
16 msg=vdm.split(',')[5]
17 bvMsg = binary.ais6tobitvec(msg)
18
19 msg8 = ais_msg_8.decode(bvMsg)
20 bvMsg8 = msg8['BinaryData']
21 del msg8['BinaryData']
22 ais_msg_8.printFields(msg8)
23
24 print
25
26
27 slsHdr = sls_header.decode(bvMsg8)
28 bvHdr = slsHdr['BinaryData']
29 del slsHdr['BinaryData']
30 sls_header.printFields(slsHdr)
31
32
33 print
34
35 wl = sls_waterlevel.decode(bvHdr)
36 sls_waterlevel.printFields(wl)
37