_BaseGNSSSetup.py
Go to the documentation of this file.
00001 """autogenerated by genpy from applanix_msgs/BaseGNSSSetup.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 
00008 class BaseGNSSSetup(genpy.Message):
00009   _md5sum = "d1009e68ee977cbe61164b28eb218883"
00010   _type = "applanix_msgs/BaseGNSSSetup"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint16 transaction
00013 
00014 # TODO: enums
00015 uint16 TYPE_NONE=0
00016 uint16 TYPE_RTCM_1=1
00017 uint16 TYPE_RTCM_3=2
00018 uint16 TYPE_CMR=3
00019 uint16 base_gnss_input_type
00020 
00021 uint8 line_control
00022 
00023 uint8 modem_control
00024 
00025 uint8 connection_control
00026 
00027 uint8[32] phone_number
00028 
00029 uint8 num_redials
00030 
00031 uint8[64] modem_command_string
00032 
00033 uint8[128] modem_init_string
00034 
00035 uint16 data_timeout_length
00036 
00037 uint16 DATUM_WGS84=0
00038 uint16 DATUM_NAD83=1
00039 uint16 datum
00040 
00041 """
00042   # Pseudo-constants
00043   TYPE_NONE = 0
00044   TYPE_RTCM_1 = 1
00045   TYPE_RTCM_3 = 2
00046   TYPE_CMR = 3
00047   DATUM_WGS84 = 0
00048   DATUM_NAD83 = 1
00049 
00050   __slots__ = ['transaction','base_gnss_input_type','line_control','modem_control','connection_control','phone_number','num_redials','modem_command_string','modem_init_string','data_timeout_length','datum']
00051   _slot_types = ['uint16','uint16','uint8','uint8','uint8','uint8[32]','uint8','uint8[64]','uint8[128]','uint16','uint16']
00052 
00053   def __init__(self, *args, **kwds):
00054     """
00055     Constructor. Any message fields that are implicitly/explicitly
00056     set to None will be assigned a default value. The recommend
00057     use is keyword arguments as this is more robust to future message
00058     changes.  You cannot mix in-order arguments and keyword arguments.
00059 
00060     The available fields are:
00061        transaction,base_gnss_input_type,line_control,modem_control,connection_control,phone_number,num_redials,modem_command_string,modem_init_string,data_timeout_length,datum
00062 
00063     :param args: complete set of field values, in .msg order
00064     :param kwds: use keyword arguments corresponding to message field names
00065     to set specific fields.
00066     """
00067     if args or kwds:
00068       super(BaseGNSSSetup, self).__init__(*args, **kwds)
00069       #message fields cannot be None, assign default values for those that are
00070       if self.transaction is None:
00071         self.transaction = 0
00072       if self.base_gnss_input_type is None:
00073         self.base_gnss_input_type = 0
00074       if self.line_control is None:
00075         self.line_control = 0
00076       if self.modem_control is None:
00077         self.modem_control = 0
00078       if self.connection_control is None:
00079         self.connection_control = 0
00080       if self.phone_number is None:
00081         self.phone_number = chr(0)*32
00082       if self.num_redials is None:
00083         self.num_redials = 0
00084       if self.modem_command_string is None:
00085         self.modem_command_string = chr(0)*64
00086       if self.modem_init_string is None:
00087         self.modem_init_string = chr(0)*128
00088       if self.data_timeout_length is None:
00089         self.data_timeout_length = 0
00090       if self.datum is None:
00091         self.datum = 0
00092     else:
00093       self.transaction = 0
00094       self.base_gnss_input_type = 0
00095       self.line_control = 0
00096       self.modem_control = 0
00097       self.connection_control = 0
00098       self.phone_number = chr(0)*32
00099       self.num_redials = 0
00100       self.modem_command_string = chr(0)*64
00101       self.modem_init_string = chr(0)*128
00102       self.data_timeout_length = 0
00103       self.datum = 0
00104 
00105   def _get_types(self):
00106     """
00107     internal API method
00108     """
00109     return self._slot_types
00110 
00111   def serialize(self, buff):
00112     """
00113     serialize message into buffer
00114     :param buff: buffer, ``StringIO``
00115     """
00116     try:
00117       _x = self
00118       buff.write(_struct_2H3B.pack(_x.transaction, _x.base_gnss_input_type, _x.line_control, _x.modem_control, _x.connection_control))
00119       _x = self.phone_number
00120       # - if encoded as a list instead, serialize as bytes instead of string
00121       if type(_x) in [list, tuple]:
00122         buff.write(_struct_32B.pack(*_x))
00123       else:
00124         buff.write(_struct_32s.pack(_x))
00125       buff.write(_struct_B.pack(self.num_redials))
00126       _x = self.modem_command_string
00127       # - if encoded as a list instead, serialize as bytes instead of string
00128       if type(_x) in [list, tuple]:
00129         buff.write(_struct_64B.pack(*_x))
00130       else:
00131         buff.write(_struct_64s.pack(_x))
00132       _x = self.modem_init_string
00133       # - if encoded as a list instead, serialize as bytes instead of string
00134       if type(_x) in [list, tuple]:
00135         buff.write(_struct_128B.pack(*_x))
00136       else:
00137         buff.write(_struct_128s.pack(_x))
00138       _x = self
00139       buff.write(_struct_2H.pack(_x.data_timeout_length, _x.datum))
00140     except struct.error as se: self._check_types(se)
00141     except TypeError as te: self._check_types(te)
00142 
00143   def deserialize(self, str):
00144     """
00145     unpack serialized message in str into this message instance
00146     :param str: byte array of serialized message, ``str``
00147     """
00148     try:
00149       end = 0
00150       _x = self
00151       start = end
00152       end += 7
00153       (_x.transaction, _x.base_gnss_input_type, _x.line_control, _x.modem_control, _x.connection_control,) = _struct_2H3B.unpack(str[start:end])
00154       start = end
00155       end += 32
00156       self.phone_number = str[start:end]
00157       start = end
00158       end += 1
00159       (self.num_redials,) = _struct_B.unpack(str[start:end])
00160       start = end
00161       end += 64
00162       self.modem_command_string = str[start:end]
00163       start = end
00164       end += 128
00165       self.modem_init_string = str[start:end]
00166       _x = self
00167       start = end
00168       end += 4
00169       (_x.data_timeout_length, _x.datum,) = _struct_2H.unpack(str[start:end])
00170       return self
00171     except struct.error as e:
00172       raise genpy.DeserializationError(e) #most likely buffer underfill
00173 
00174 
00175   def serialize_numpy(self, buff, numpy):
00176     """
00177     serialize message with numpy array types into buffer
00178     :param buff: buffer, ``StringIO``
00179     :param numpy: numpy python module
00180     """
00181     try:
00182       _x = self
00183       buff.write(_struct_2H3B.pack(_x.transaction, _x.base_gnss_input_type, _x.line_control, _x.modem_control, _x.connection_control))
00184       _x = self.phone_number
00185       # - if encoded as a list instead, serialize as bytes instead of string
00186       if type(_x) in [list, tuple]:
00187         buff.write(_struct_32B.pack(*_x))
00188       else:
00189         buff.write(_struct_32s.pack(_x))
00190       buff.write(_struct_B.pack(self.num_redials))
00191       _x = self.modem_command_string
00192       # - if encoded as a list instead, serialize as bytes instead of string
00193       if type(_x) in [list, tuple]:
00194         buff.write(_struct_64B.pack(*_x))
00195       else:
00196         buff.write(_struct_64s.pack(_x))
00197       _x = self.modem_init_string
00198       # - if encoded as a list instead, serialize as bytes instead of string
00199       if type(_x) in [list, tuple]:
00200         buff.write(_struct_128B.pack(*_x))
00201       else:
00202         buff.write(_struct_128s.pack(_x))
00203       _x = self
00204       buff.write(_struct_2H.pack(_x.data_timeout_length, _x.datum))
00205     except struct.error as se: self._check_types(se)
00206     except TypeError as te: self._check_types(te)
00207 
00208   def deserialize_numpy(self, str, numpy):
00209     """
00210     unpack serialized message in str into this message instance using numpy for array types
00211     :param str: byte array of serialized message, ``str``
00212     :param numpy: numpy python module
00213     """
00214     try:
00215       end = 0
00216       _x = self
00217       start = end
00218       end += 7
00219       (_x.transaction, _x.base_gnss_input_type, _x.line_control, _x.modem_control, _x.connection_control,) = _struct_2H3B.unpack(str[start:end])
00220       start = end
00221       end += 32
00222       self.phone_number = str[start:end]
00223       start = end
00224       end += 1
00225       (self.num_redials,) = _struct_B.unpack(str[start:end])
00226       start = end
00227       end += 64
00228       self.modem_command_string = str[start:end]
00229       start = end
00230       end += 128
00231       self.modem_init_string = str[start:end]
00232       _x = self
00233       start = end
00234       end += 4
00235       (_x.data_timeout_length, _x.datum,) = _struct_2H.unpack(str[start:end])
00236       return self
00237     except struct.error as e:
00238       raise genpy.DeserializationError(e) #most likely buffer underfill
00239 
00240 _struct_I = genpy.struct_I
00241 _struct_32B = struct.Struct("<32B")
00242 _struct_B = struct.Struct("<B")
00243 _struct_128s = struct.Struct("<128s")
00244 _struct_32s = struct.Struct("<32s")
00245 _struct_64s = struct.Struct("<64s")
00246 _struct_64B = struct.Struct("<64B")
00247 _struct_128B = struct.Struct("<128B")
00248 _struct_2H = struct.Struct("<2H")
00249 _struct_2H3B = struct.Struct("<2H3B")


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