Module ais_msg_8
source code
Autogenerated python functions to serialize/deserialize binary
messages.
Generated by: ./aisxmlbinmsg2py.py
Need to then wrap these functions with the outer AIS packet and then
convert the whole binary blob to a NMEA string. Those functions are not
currently provided in this file.
serialize: python to ais binary deserialize: ais binary to python
The generated code uses translators.py, binary.py, and aisstring.py
which should be packaged with the resulting files.
Requires:
Author:
xmlbinmsg
Version:
4791
Status:
under development
License:
Generated code has no license
|
Testbin_broadcast
Use testvalue tag text from each type to build test case the
bin_broadcast message
|
|
__date__ = '2007-01-02'
Date of last svn commit
|
|
TrueBV = <ais.BitVector.BitVector object at 0x2262490>
Why always rebuild the True bit? This should speed things up a
bunch
|
|
FalseBV = <ais.BitVector.BitVector object at 0x2262510>
Why always rebuild the False bit? This should speed things up a
bunch
|
|
typeChoices = 'binary', 'nmeapayload', 'nmea'
|
|
msgDict = {'MessageID': '8', 'RepeatIndicator': options.Repeat...
|
|
bitLen = len(bits)
|
|
bits = bits+ BitVector(size= (6-(bitLen % 6)))
|
Create a bin_broadcast binary message payload to pack into an AIS Msg
bin_broadcast.
Fields in params:
-
MessageID(uint): AIS message number. Must be 8 (field
automatically set to "8")
-
RepeatIndicator(uint): Indicated how many times a message has been
repeated
-
UserID(uint): Unique ship identification number (MMSI)
-
Spare(uint): Reserved for definition by a regional authority.
(field automatically set to "0")
-
BinaryData(binary): Bits for a binary broadcast message
-
- Parameters:
params - Dictionary of field names/values. Throws a ValueError
exception if required is missing
validate - Set to true to cause checking to occur. Runs slower. FIX:
not implemented.
- Returns:
BitVector
- encoded binary message (for binary messages, this needs to be
wrapped in a msg 8
Note:
The returned bits may not be 6 bit aligned. It is up to you to
pad out the bits.
|
Unpack a bin_broadcast message
Fields in params:
-
MessageID(uint): AIS message number. Must be 8 (field
automatically set to "8")
-
RepeatIndicator(uint): Indicated how many times a message has been
repeated
-
UserID(uint): Unique ship identification number (MMSI)
-
Spare(uint): Reserved for definition by a regional authority.
(field automatically set to "0")
-
BinaryData(binary): Bits for a binary broadcast message
-
- Parameters:
bv (BitVector ) - Bits defining a message
validate - Set to true to cause checking to occur. Runs slower. FIX:
not implemented.
- Returns:
dict
- params
|
printFields(params,
out=sys.stdout,
format='std')
| source code |
Print a bin_broadcast message to stdout.
Fields in params:
-
MessageID(uint): AIS message number. Must be 8 (field
automatically set to "8")
-
RepeatIndicator(uint): Indicated how many times a message has been
repeated
-
UserID(uint): Unique ship identification number (MMSI)
-
Spare(uint): Reserved for definition by a regional authority.
(field automatically set to "0")
-
BinaryData(binary): Bits for a binary broadcast message
-
- Parameters:
params - Dictionary of field names/values.
out - File like object to write to
- Returns:
stdout
- text to out
|
Return a params file base on the testvalue tags.
-
- Returns:
dict
- params based on testvalue tags
|
__date__
Date of last svn commit
-
- Value:
|
TrueBV
Why always rebuild the True bit? This should speed things up a
bunch
-
- Value:
<ais.BitVector.BitVector object at 0x2262490>
|
|
FalseBV
Why always rebuild the False bit? This should speed things up a
bunch
-
- Value:
<ais.BitVector.BitVector object at 0x2262510>
|
|
typeChoices
None
-
- Value:
'binary', 'nmeapayload', 'nmea'
|
|
msgDict
None
-
- Value:
{'MessageID': '8', 'RepeatIndicator': options.RepeatIndicatorField, 'U
serID': options.UserIDField, 'Spare': '0', 'BinaryData': options.Binar
yDataField,}
|
|
bits
None
-
- Value:
bits+ BitVector(size= (6-(bitLen % 6)))
|
|