$search
00001 """autogenerated by genmsg_py from BaseGNSSModemStatus.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 import applanix_msgs.msg 00006 00007 class BaseGNSSModemStatus(roslib.message.Message): 00008 _md5sum = "00919adef7a8ce91b9d8181ce0e31f4b" 00009 _type = "applanix_msgs/BaseGNSSModemStatus" 00010 _has_header = False #flag to mark the presence of a Header object 00011 _full_text = """# Groups 21, 22 00012 TimeDistance td 00013 00014 uint8[16] modem_response 00015 uint8[48] connection_status 00016 00017 uint32 redials_per_disconnect 00018 uint32 max_redials_per_disconnect 00019 uint32 num_disconnects 00020 uint32 data_gap_length 00021 uint32 max_data_gap_length 00022 00023 ================================================================================ 00024 MSG: applanix_msgs/TimeDistance 00025 float64 time1 00026 float64 time2 00027 float64 distance 00028 uint8 time_types 00029 uint8 distance_type 00030 00031 """ 00032 __slots__ = ['td','modem_response','connection_status','redials_per_disconnect','max_redials_per_disconnect','num_disconnects','data_gap_length','max_data_gap_length'] 00033 _slot_types = ['applanix_msgs/TimeDistance','uint8[16]','uint8[48]','uint32','uint32','uint32','uint32','uint32'] 00034 00035 def __init__(self, *args, **kwds): 00036 """ 00037 Constructor. Any message fields that are implicitly/explicitly 00038 set to None will be assigned a default value. The recommend 00039 use is keyword arguments as this is more robust to future message 00040 changes. You cannot mix in-order arguments and keyword arguments. 00041 00042 The available fields are: 00043 td,modem_response,connection_status,redials_per_disconnect,max_redials_per_disconnect,num_disconnects,data_gap_length,max_data_gap_length 00044 00045 @param args: complete set of field values, in .msg order 00046 @param kwds: use keyword arguments corresponding to message field names 00047 to set specific fields. 00048 """ 00049 if args or kwds: 00050 super(BaseGNSSModemStatus, self).__init__(*args, **kwds) 00051 #message fields cannot be None, assign default values for those that are 00052 if self.td is None: 00053 self.td = applanix_msgs.msg.TimeDistance() 00054 if self.modem_response is None: 00055 self.modem_response = chr(0)*16 00056 if self.connection_status is None: 00057 self.connection_status = chr(0)*48 00058 if self.redials_per_disconnect is None: 00059 self.redials_per_disconnect = 0 00060 if self.max_redials_per_disconnect is None: 00061 self.max_redials_per_disconnect = 0 00062 if self.num_disconnects is None: 00063 self.num_disconnects = 0 00064 if self.data_gap_length is None: 00065 self.data_gap_length = 0 00066 if self.max_data_gap_length is None: 00067 self.max_data_gap_length = 0 00068 else: 00069 self.td = applanix_msgs.msg.TimeDistance() 00070 self.modem_response = chr(0)*16 00071 self.connection_status = chr(0)*48 00072 self.redials_per_disconnect = 0 00073 self.max_redials_per_disconnect = 0 00074 self.num_disconnects = 0 00075 self.data_gap_length = 0 00076 self.max_data_gap_length = 0 00077 00078 def _get_types(self): 00079 """ 00080 internal API method 00081 """ 00082 return self._slot_types 00083 00084 def serialize(self, buff): 00085 """ 00086 serialize message into buffer 00087 @param buff: buffer 00088 @type buff: StringIO 00089 """ 00090 try: 00091 _x = self 00092 buff.write(_struct_3d2B.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type)) 00093 _x = self.modem_response 00094 # - if encoded as a list instead, serialize as bytes instead of string 00095 if type(_x) in [list, tuple]: 00096 buff.write(_struct_16B.pack(*_x)) 00097 else: 00098 buff.write(_struct_16s.pack(_x)) 00099 _x = self.connection_status 00100 # - if encoded as a list instead, serialize as bytes instead of string 00101 if type(_x) in [list, tuple]: 00102 buff.write(_struct_48B.pack(*_x)) 00103 else: 00104 buff.write(_struct_48s.pack(_x)) 00105 _x = self 00106 buff.write(_struct_5I.pack(_x.redials_per_disconnect, _x.max_redials_per_disconnect, _x.num_disconnects, _x.data_gap_length, _x.max_data_gap_length)) 00107 except struct.error as se: self._check_types(se) 00108 except TypeError as te: self._check_types(te) 00109 00110 def deserialize(self, str): 00111 """ 00112 unpack serialized message in str into this message instance 00113 @param str: byte array of serialized message 00114 @type str: str 00115 """ 00116 try: 00117 if self.td is None: 00118 self.td = applanix_msgs.msg.TimeDistance() 00119 end = 0 00120 _x = self 00121 start = end 00122 end += 26 00123 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type,) = _struct_3d2B.unpack(str[start:end]) 00124 start = end 00125 end += 16 00126 self.modem_response = str[start:end] 00127 start = end 00128 end += 48 00129 self.connection_status = str[start:end] 00130 _x = self 00131 start = end 00132 end += 20 00133 (_x.redials_per_disconnect, _x.max_redials_per_disconnect, _x.num_disconnects, _x.data_gap_length, _x.max_data_gap_length,) = _struct_5I.unpack(str[start:end]) 00134 return self 00135 except struct.error as e: 00136 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00137 00138 00139 def serialize_numpy(self, buff, numpy): 00140 """ 00141 serialize message with numpy array types into buffer 00142 @param buff: buffer 00143 @type buff: StringIO 00144 @param numpy: numpy python module 00145 @type numpy module 00146 """ 00147 try: 00148 _x = self 00149 buff.write(_struct_3d2B.pack(_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type)) 00150 _x = self.modem_response 00151 # - if encoded as a list instead, serialize as bytes instead of string 00152 if type(_x) in [list, tuple]: 00153 buff.write(_struct_16B.pack(*_x)) 00154 else: 00155 buff.write(_struct_16s.pack(_x)) 00156 _x = self.connection_status 00157 # - if encoded as a list instead, serialize as bytes instead of string 00158 if type(_x) in [list, tuple]: 00159 buff.write(_struct_48B.pack(*_x)) 00160 else: 00161 buff.write(_struct_48s.pack(_x)) 00162 _x = self 00163 buff.write(_struct_5I.pack(_x.redials_per_disconnect, _x.max_redials_per_disconnect, _x.num_disconnects, _x.data_gap_length, _x.max_data_gap_length)) 00164 except struct.error as se: self._check_types(se) 00165 except TypeError as te: self._check_types(te) 00166 00167 def deserialize_numpy(self, str, numpy): 00168 """ 00169 unpack serialized message in str into this message instance using numpy for array types 00170 @param str: byte array of serialized message 00171 @type str: str 00172 @param numpy: numpy python module 00173 @type numpy: module 00174 """ 00175 try: 00176 if self.td is None: 00177 self.td = applanix_msgs.msg.TimeDistance() 00178 end = 0 00179 _x = self 00180 start = end 00181 end += 26 00182 (_x.td.time1, _x.td.time2, _x.td.distance, _x.td.time_types, _x.td.distance_type,) = _struct_3d2B.unpack(str[start:end]) 00183 start = end 00184 end += 16 00185 self.modem_response = str[start:end] 00186 start = end 00187 end += 48 00188 self.connection_status = str[start:end] 00189 _x = self 00190 start = end 00191 end += 20 00192 (_x.redials_per_disconnect, _x.max_redials_per_disconnect, _x.num_disconnects, _x.data_gap_length, _x.max_data_gap_length,) = _struct_5I.unpack(str[start:end]) 00193 return self 00194 except struct.error as e: 00195 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00196 00197 _struct_I = roslib.message.struct_I 00198 _struct_3d2B = struct.Struct("<3d2B") 00199 _struct_48B = struct.Struct("<48B") 00200 _struct_16B = struct.Struct("<16B") 00201 _struct_5I = struct.Struct("<5I") 00202 _struct_48s = struct.Struct("<48s") 00203 _struct_16s = struct.Struct("<16s")