_NMEAMessageSelect.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/NMEAMessageSelect.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import applanix_msgs.msg
00008 
00009 class NMEAMessageSelect(genpy.Message):
00010   _md5sum = "d988d97031c9db73713ce27fde744cff"
00011   _type = "applanix_msgs/NMEAMessageSelect"
00012   _has_header = False #flag to mark the presence of a Header object
00013   _full_text = """# Msg 35
00014 uint16 transaction
00015 
00016 uint8[9] reserved
00017 
00018 uint8 TALKER_IN=0
00019 uint8 TALKER_GP=1
00020 uint8 talker
00021 
00022 uint8 ports_count
00023 COMPortMessages[] ports
00024 
00025 ================================================================================
00026 MSG: applanix_msgs/COMPortMessages
00027 uint8 port_num
00028 
00029 uint32 MESSAGES_NMEA_GST=1
00030 uint32 MESSAGES_NMEA_GGA=2
00031 uint32 MESSAGES_NMEA_HDT=4
00032 uint32 MESSAGES_NMEA_ZDA=8
00033 uint32 MESSAGES_NMEA_EVT1=16
00034 uint32 MESSAGES_NMEA_EVT2=32
00035 uint32 MESSAGES_NMEA_VTG=64
00036 uint32 MESSAGES_NMEA_PASHR=128
00037 uint32 MESSAGES_NMEA_GGA2=8192
00038 uint32 MESSAGES_NMEA_PPS=16384
00039 uint32 MESSAGES_NMEA_GGK=32768
00040 uint32 MESSAGES_NMEA_RMC=65536
00041 uint32 MESSAGES_BIN_GIMBAL_LOOP=1
00042 uint32 MESSAGES_BIN_RDR1=2
00043 uint32 MESSAGES_BIN_PAST2=4
00044 uint32 MESSAGES_BIN_PPS=65536
00045 uint32 MESSAGES_BIN_TM1B=131072
00046 uint32 messages
00047 
00048 uint8 update_rate
00049 
00050 """
00051   # Pseudo-constants
00052   TALKER_IN = 0
00053   TALKER_GP = 1
00054 
00055   __slots__ = ['transaction','reserved','talker','ports_count','ports']
00056   _slot_types = ['uint16','uint8[9]','uint8','uint8','applanix_msgs/COMPortMessages[]']
00057 
00058   def __init__(self, *args, **kwds):
00059     """
00060     Constructor. Any message fields that are implicitly/explicitly
00061     set to None will be assigned a default value. The recommend
00062     use is keyword arguments as this is more robust to future message
00063     changes.  You cannot mix in-order arguments and keyword arguments.
00064 
00065     The available fields are:
00066        transaction,reserved,talker,ports_count,ports
00067 
00068     :param args: complete set of field values, in .msg order
00069     :param kwds: use keyword arguments corresponding to message field names
00070     to set specific fields.
00071     """
00072     if args or kwds:
00073       super(NMEAMessageSelect, self).__init__(*args, **kwds)
00074       #message fields cannot be None, assign default values for those that are
00075       if self.transaction is None:
00076         self.transaction = 0
00077       if self.reserved is None:
00078         self.reserved = chr(0)*9
00079       if self.talker is None:
00080         self.talker = 0
00081       if self.ports_count is None:
00082         self.ports_count = 0
00083       if self.ports is None:
00084         self.ports = []
00085     else:
00086       self.transaction = 0
00087       self.reserved = chr(0)*9
00088       self.talker = 0
00089       self.ports_count = 0
00090       self.ports = []
00091 
00092   def _get_types(self):
00093     """
00094     internal API method
00095     """
00096     return self._slot_types
00097 
00098   def serialize(self, buff):
00099     """
00100     serialize message into buffer
00101     :param buff: buffer, ``StringIO``
00102     """
00103     try:
00104       buff.write(_struct_H.pack(self.transaction))
00105       _x = self.reserved
00106       # - if encoded as a list instead, serialize as bytes instead of string
00107       if type(_x) in [list, tuple]:
00108         buff.write(_struct_9B.pack(*_x))
00109       else:
00110         buff.write(_struct_9s.pack(_x))
00111       _x = self
00112       buff.write(_struct_2B.pack(_x.talker, _x.ports_count))
00113       length = len(self.ports)
00114       buff.write(_struct_I.pack(length))
00115       for val1 in self.ports:
00116         _x = val1
00117         buff.write(_struct_BIB.pack(_x.port_num, _x.messages, _x.update_rate))
00118     except struct.error as se: self._check_types(se)
00119     except TypeError as te: self._check_types(te)
00120 
00121   def deserialize(self, str):
00122     """
00123     unpack serialized message in str into this message instance
00124     :param str: byte array of serialized message, ``str``
00125     """
00126     try:
00127       if self.ports is None:
00128         self.ports = None
00129       end = 0
00130       start = end
00131       end += 2
00132       (self.transaction,) = _struct_H.unpack(str[start:end])
00133       start = end
00134       end += 9
00135       self.reserved = str[start:end]
00136       _x = self
00137       start = end
00138       end += 2
00139       (_x.talker, _x.ports_count,) = _struct_2B.unpack(str[start:end])
00140       start = end
00141       end += 4
00142       (length,) = _struct_I.unpack(str[start:end])
00143       self.ports = []
00144       for i in range(0, length):
00145         val1 = applanix_msgs.msg.COMPortMessages()
00146         _x = val1
00147         start = end
00148         end += 6
00149         (_x.port_num, _x.messages, _x.update_rate,) = _struct_BIB.unpack(str[start:end])
00150         self.ports.append(val1)
00151       return self
00152     except struct.error as e:
00153       raise genpy.DeserializationError(e) #most likely buffer underfill
00154 
00155 
00156   def serialize_numpy(self, buff, numpy):
00157     """
00158     serialize message with numpy array types into buffer
00159     :param buff: buffer, ``StringIO``
00160     :param numpy: numpy python module
00161     """
00162     try:
00163       buff.write(_struct_H.pack(self.transaction))
00164       _x = self.reserved
00165       # - if encoded as a list instead, serialize as bytes instead of string
00166       if type(_x) in [list, tuple]:
00167         buff.write(_struct_9B.pack(*_x))
00168       else:
00169         buff.write(_struct_9s.pack(_x))
00170       _x = self
00171       buff.write(_struct_2B.pack(_x.talker, _x.ports_count))
00172       length = len(self.ports)
00173       buff.write(_struct_I.pack(length))
00174       for val1 in self.ports:
00175         _x = val1
00176         buff.write(_struct_BIB.pack(_x.port_num, _x.messages, _x.update_rate))
00177     except struct.error as se: self._check_types(se)
00178     except TypeError as te: self._check_types(te)
00179 
00180   def deserialize_numpy(self, str, numpy):
00181     """
00182     unpack serialized message in str into this message instance using numpy for array types
00183     :param str: byte array of serialized message, ``str``
00184     :param numpy: numpy python module
00185     """
00186     try:
00187       if self.ports is None:
00188         self.ports = None
00189       end = 0
00190       start = end
00191       end += 2
00192       (self.transaction,) = _struct_H.unpack(str[start:end])
00193       start = end
00194       end += 9
00195       self.reserved = str[start:end]
00196       _x = self
00197       start = end
00198       end += 2
00199       (_x.talker, _x.ports_count,) = _struct_2B.unpack(str[start:end])
00200       start = end
00201       end += 4
00202       (length,) = _struct_I.unpack(str[start:end])
00203       self.ports = []
00204       for i in range(0, length):
00205         val1 = applanix_msgs.msg.COMPortMessages()
00206         _x = val1
00207         start = end
00208         end += 6
00209         (_x.port_num, _x.messages, _x.update_rate,) = _struct_BIB.unpack(str[start:end])
00210         self.ports.append(val1)
00211       return self
00212     except struct.error as e:
00213       raise genpy.DeserializationError(e) #most likely buffer underfill
00214 
00215 _struct_I = genpy.struct_I
00216 _struct_H = struct.Struct("<H")
00217 _struct_9s = struct.Struct("<9s")
00218 _struct_9B = struct.Struct("<9B")
00219 _struct_BIB = struct.Struct("<BIB")
00220 _struct_2B = struct.Struct("<2B")


applanix_msgs
Author(s): Mike Purvis
autogenerated on Thu Jan 2 2014 11:04:51