Package ais :: Module prototype
[hide private]
[frames] | no frames]

Module prototype

source code

Autogenerated python functions to serialize/deserialize binary messages.

Generated by: ./xmlbinmsg.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: 5275

Status: under development

License: Generated code has no license

Date: 2007-01-02

Classes [hide private]
  TestEncode
Unit testing of the Template class.
Functions [hide private]
 
encode(params, validate=False, **moreParams)
Serializer for the waterlevel binary message
source code
 
decode(bv, validate=False)
Deserialize a binary water levelmessage
source code
Function Details [hide private]

encode(params, validate=False, **moreParams)

source code 

Serializer for the waterlevel binary message

Keywords and types:
  • dac: uint
  • unavail_uint: uint
  • uint: uint

FIX: generate CORRECT doctest string that does all the defaults

The default message:
>>> print encode()
1011011101100
Parameters:
  • aDict - for passing in a dictionary of keyword and values.
  • params - keyword dictionary or if a dict is passed, it will use that dict
Returns:
bitvector

Note: only use one of aDict or params

Bug: FIX: have moreParams add to and override params

decode(bv, validate=False)

source code 
Deserialize a binary water levelmessage
Parameters:
  • bv - bitvector containing the message portion of the assembled transmission
  • validate - set to true to check parsed values. If false, constant fields will not be parsed.
Returns:
dictory of fields and values