forked from asdf1011/libaisdec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
31 lines (18 loc) · 979 Bytes
/
README
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
libaisdec is a library to decode ais packets as documented in ITU-R M.1371-4.
It requires the bdec decoder library (www.protocollogic.com).
https://github.com/asdf1011/bdec
The easiest way to install bdec is to use python's easy_install
(https://pypi.python.org/pypi/setuptools#installation-instructions) application.
Run: easy_install bdec
To decode an aivdm encoded file, run
./decode.py somefile.aivdm
To generate a c-language decoder / encoder, run
mkdir output_dir
bcompile -d output_dir --encoder spec/ais*.xml
Note that this will decode the binary representation, not the aivdm; to
convert aivdm to and from binary also compile the aivdm specification;
bcompile -d output_dir --encoder spec/aivdm.xml
In code, populate the generated Aivdm structure (in aivdm.h) (one byte per
array entry), and call the encodeAivdm function to get the binary
representation. Pass this encoded buffer in the EncodedBuffer structure
to decodePacket in 'packet.h'.