Module ais_msg_1
[hide private]
[frames] | no frames]

Module ais_msg_1

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

Classes [hide private]
  Testposition
Uses the testvalue tag text from each type to build a test case for the position message

Functions [hide private]
BitVector positionEncode(params, validate=False)
Create a position binary message payload to pack into an AIS Msg position.
dict positionDecode(bv, validate=False)
Unpack a position message
stdout positionPrint(params, out=sys.stdout)
Print a position message to stdout.
dict positionTestParams()
Return a params file base on the testvalue tags.

Variables [hide private]
  __date__ = '2006-12-12'
Date of last svn commit
  TrueBV = <BitVector.BitVector object at 0x124f530>
Why always rebuild the True bit? This should speed things up a bunch
  FalseBV = <BitVector.BitVector object at 0x1253590>
Why always rebuild the False bit? This should speed things up a bunch

Function Details [hide private]

positionEncode(params, validate=False)

source code 

Create a position binary message payload to pack into an AIS Msg position.

Fields in params:
  • MessageID(uint): AIS message number. Must be 1 (field automatically set to "1")
  • RepeatIndicator(uint): Indicated how many times a message has been repeated
  • UserID(uint): Unique ship identification number (MMSI)
  • NavigationStatus(uint): What is the vessel doing
  • ROT(int): RateOfTurn
  • SOG(udecimal): Speed over ground
  • PositionAccuracy(uint): Accuracy of positioning fixes
  • Position_longitude(decimal): Location of the vessel East West location
  • Position_latitude(decimal): Location of the vessel North South location
  • COG(udecimal): Course over ground
  • TrueHeading(uint): True heading (relative to true North)
  • TimeStamp(uint): UTC second when the report was generated
  • RegionalReserved(uint): Reserved for definition by a regional authority. (field automatically set to "0")
  • Spare(uint): Reserved for definition by a regional authority. (field automatically set to "0")
  • RAIM(bool): Receiver autonomous integrity monitoring flag
  • syncstate(uint): Sycronization state
  • slotoffset(uint): In what slot will the next transmission occur. BROKEN
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

positionDecode(bv, validate=False)

source code 

Unpack a position message

Fields in params:
  • MessageID(uint): AIS message number. Must be 1 (field automatically set to "1")
  • RepeatIndicator(uint): Indicated how many times a message has been repeated
  • UserID(uint): Unique ship identification number (MMSI)
  • NavigationStatus(uint): What is the vessel doing
  • ROT(int): RateOfTurn
  • SOG(udecimal): Speed over ground
  • PositionAccuracy(uint): Accuracy of positioning fixes
  • Position_longitude(decimal): Location of the vessel East West location
  • Position_latitude(decimal): Location of the vessel North South location
  • COG(udecimal): Course over ground
  • TrueHeading(uint): True heading (relative to true North)
  • TimeStamp(uint): UTC second when the report was generated
  • RegionalReserved(uint): Reserved for definition by a regional authority. (field automatically set to "0")
  • Spare(uint): Reserved for definition by a regional authority. (field automatically set to "0")
  • RAIM(bool): Receiver autonomous integrity monitoring flag
  • syncstate(uint): Sycronization state
  • slotoffset(uint): In what slot will the next transmission occur. BROKEN
Parameters:
  • bv (BitVector) - Bits defining a message
  • validate - Set to true to cause checking to occur. Runs slower. FIX: not implemented.
Returns: dict
params

positionPrint(params, out=sys.stdout)

source code 

Print a position message to stdout.

Fields in params:
  • MessageID(uint): AIS message number. Must be 1 (field automatically set to "1")
  • RepeatIndicator(uint): Indicated how many times a message has been repeated
  • UserID(uint): Unique ship identification number (MMSI)
  • NavigationStatus(uint): What is the vessel doing
  • ROT(int): RateOfTurn
  • SOG(udecimal): Speed over ground
  • PositionAccuracy(uint): Accuracy of positioning fixes
  • Position_longitude(decimal): Location of the vessel East West location
  • Position_latitude(decimal): Location of the vessel North South location
  • COG(udecimal): Course over ground
  • TrueHeading(uint): True heading (relative to true North)
  • TimeStamp(uint): UTC second when the report was generated
  • RegionalReserved(uint): Reserved for definition by a regional authority. (field automatically set to "0")
  • Spare(uint): Reserved for definition by a regional authority. (field automatically set to "0")
  • RAIM(bool): Receiver autonomous integrity monitoring flag
  • syncstate(uint): Sycronization state
  • slotoffset(uint): In what slot will the next transmission occur. BROKEN
Parameters:
  • params - Dictionary of field names/values.
  • out - File like object to write to
Returns: stdout
text to out

positionTestParams()

source code 
Return a params file base on the testvalue tags.
Returns: dict
params based on testvalue tags

Variables Details [hide private]

__date__

Date of last svn commit
Value:
'2006-12-12'                                                           
      

TrueBV

Why always rebuild the True bit? This should speed things up a bunch
Value:
<BitVector.BitVector object at 0x124f530>                              
      

FalseBV

Why always rebuild the False bit? This should speed things up a bunch
Value:
<BitVector.BitVector object at 0x1253590>