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