_ConnectHub.py
Go to the documentation of this file.
00001 """autogenerated by genpy from gateway_comms/ConnectHubRequest.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 ConnectHubRequest(genpy.Message):
00009   _md5sum = "636fe5e07550f026d28388e95c38a9f4"
00010   _type = "gateway_comms/ConnectHubRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """
00013 
00014 string uri
00015 
00016 """
00017   __slots__ = ['uri']
00018   _slot_types = ['string']
00019 
00020   def __init__(self, *args, **kwds):
00021     """
00022     Constructor. Any message fields that are implicitly/explicitly
00023     set to None will be assigned a default value. The recommend
00024     use is keyword arguments as this is more robust to future message
00025     changes.  You cannot mix in-order arguments and keyword arguments.
00026 
00027     The available fields are:
00028        uri
00029 
00030     :param args: complete set of field values, in .msg order
00031     :param kwds: use keyword arguments corresponding to message field names
00032     to set specific fields.
00033     """
00034     if args or kwds:
00035       super(ConnectHubRequest, self).__init__(*args, **kwds)
00036       #message fields cannot be None, assign default values for those that are
00037       if self.uri is None:
00038         self.uri = ''
00039     else:
00040       self.uri = ''
00041 
00042   def _get_types(self):
00043     """
00044     internal API method
00045     """
00046     return self._slot_types
00047 
00048   def serialize(self, buff):
00049     """
00050     serialize message into buffer
00051     :param buff: buffer, ``StringIO``
00052     """
00053     try:
00054       _x = self.uri
00055       length = len(_x)
00056       if python3 or type(_x) == unicode:
00057         _x = _x.encode('utf-8')
00058         length = len(_x)
00059       buff.write(struct.pack('<I%ss'%length, length, _x))
00060     except struct.error as se: self._check_types(se)
00061     except TypeError as te: self._check_types(te)
00062 
00063   def deserialize(self, str):
00064     """
00065     unpack serialized message in str into this message instance
00066     :param str: byte array of serialized message, ``str``
00067     """
00068     try:
00069       end = 0
00070       start = end
00071       end += 4
00072       (length,) = _struct_I.unpack(str[start:end])
00073       start = end
00074       end += length
00075       if python3:
00076         self.uri = str[start:end].decode('utf-8')
00077       else:
00078         self.uri = str[start:end]
00079       return self
00080     except struct.error as e:
00081       raise genpy.DeserializationError(e) #most likely buffer underfill
00082 
00083 
00084   def serialize_numpy(self, buff, numpy):
00085     """
00086     serialize message with numpy array types into buffer
00087     :param buff: buffer, ``StringIO``
00088     :param numpy: numpy python module
00089     """
00090     try:
00091       _x = self.uri
00092       length = len(_x)
00093       if python3 or type(_x) == unicode:
00094         _x = _x.encode('utf-8')
00095         length = len(_x)
00096       buff.write(struct.pack('<I%ss'%length, length, _x))
00097     except struct.error as se: self._check_types(se)
00098     except TypeError as te: self._check_types(te)
00099 
00100   def deserialize_numpy(self, str, numpy):
00101     """
00102     unpack serialized message in str into this message instance using numpy for array types
00103     :param str: byte array of serialized message, ``str``
00104     :param numpy: numpy python module
00105     """
00106     try:
00107       end = 0
00108       start = end
00109       end += 4
00110       (length,) = _struct_I.unpack(str[start:end])
00111       start = end
00112       end += length
00113       if python3:
00114         self.uri = str[start:end].decode('utf-8')
00115       else:
00116         self.uri = str[start:end]
00117       return self
00118     except struct.error as e:
00119       raise genpy.DeserializationError(e) #most likely buffer underfill
00120 
00121 _struct_I = genpy.struct_I
00122 """autogenerated by genpy from gateway_comms/ConnectHubResponse.msg. Do not edit."""
00123 import sys
00124 python3 = True if sys.hexversion > 0x03000000 else False
00125 import genpy
00126 import struct
00127 
00128 
00129 class ConnectHubResponse(genpy.Message):
00130   _md5sum = "cb1e85ae0c5f4b1c31221493724cc5aa"
00131   _type = "gateway_comms/ConnectHubResponse"
00132   _has_header = False #flag to mark the presence of a Header object
00133   _full_text = """
00134 
00135 int8 result
00136 string error_message
00137 
00138 
00139 
00140 """
00141   __slots__ = ['result','error_message']
00142   _slot_types = ['int8','string']
00143 
00144   def __init__(self, *args, **kwds):
00145     """
00146     Constructor. Any message fields that are implicitly/explicitly
00147     set to None will be assigned a default value. The recommend
00148     use is keyword arguments as this is more robust to future message
00149     changes.  You cannot mix in-order arguments and keyword arguments.
00150 
00151     The available fields are:
00152        result,error_message
00153 
00154     :param args: complete set of field values, in .msg order
00155     :param kwds: use keyword arguments corresponding to message field names
00156     to set specific fields.
00157     """
00158     if args or kwds:
00159       super(ConnectHubResponse, self).__init__(*args, **kwds)
00160       #message fields cannot be None, assign default values for those that are
00161       if self.result is None:
00162         self.result = 0
00163       if self.error_message is None:
00164         self.error_message = ''
00165     else:
00166       self.result = 0
00167       self.error_message = ''
00168 
00169   def _get_types(self):
00170     """
00171     internal API method
00172     """
00173     return self._slot_types
00174 
00175   def serialize(self, buff):
00176     """
00177     serialize message into buffer
00178     :param buff: buffer, ``StringIO``
00179     """
00180     try:
00181       buff.write(_struct_b.pack(self.result))
00182       _x = self.error_message
00183       length = len(_x)
00184       if python3 or type(_x) == unicode:
00185         _x = _x.encode('utf-8')
00186         length = len(_x)
00187       buff.write(struct.pack('<I%ss'%length, length, _x))
00188     except struct.error as se: self._check_types(se)
00189     except TypeError as te: self._check_types(te)
00190 
00191   def deserialize(self, str):
00192     """
00193     unpack serialized message in str into this message instance
00194     :param str: byte array of serialized message, ``str``
00195     """
00196     try:
00197       end = 0
00198       start = end
00199       end += 1
00200       (self.result,) = _struct_b.unpack(str[start:end])
00201       start = end
00202       end += 4
00203       (length,) = _struct_I.unpack(str[start:end])
00204       start = end
00205       end += length
00206       if python3:
00207         self.error_message = str[start:end].decode('utf-8')
00208       else:
00209         self.error_message = str[start:end]
00210       return self
00211     except struct.error as e:
00212       raise genpy.DeserializationError(e) #most likely buffer underfill
00213 
00214 
00215   def serialize_numpy(self, buff, numpy):
00216     """
00217     serialize message with numpy array types into buffer
00218     :param buff: buffer, ``StringIO``
00219     :param numpy: numpy python module
00220     """
00221     try:
00222       buff.write(_struct_b.pack(self.result))
00223       _x = self.error_message
00224       length = len(_x)
00225       if python3 or type(_x) == unicode:
00226         _x = _x.encode('utf-8')
00227         length = len(_x)
00228       buff.write(struct.pack('<I%ss'%length, length, _x))
00229     except struct.error as se: self._check_types(se)
00230     except TypeError as te: self._check_types(te)
00231 
00232   def deserialize_numpy(self, str, numpy):
00233     """
00234     unpack serialized message in str into this message instance using numpy for array types
00235     :param str: byte array of serialized message, ``str``
00236     :param numpy: numpy python module
00237     """
00238     try:
00239       end = 0
00240       start = end
00241       end += 1
00242       (self.result,) = _struct_b.unpack(str[start:end])
00243       start = end
00244       end += 4
00245       (length,) = _struct_I.unpack(str[start:end])
00246       start = end
00247       end += length
00248       if python3:
00249         self.error_message = str[start:end].decode('utf-8')
00250       else:
00251         self.error_message = str[start:end]
00252       return self
00253     except struct.error as e:
00254       raise genpy.DeserializationError(e) #most likely buffer underfill
00255 
00256 _struct_I = genpy.struct_I
00257 _struct_b = struct.Struct("<b")
00258 class ConnectHub(object):
00259   _type          = 'gateway_comms/ConnectHub'
00260   _md5sum = '6815c96f7df47a58c645055a2e0d9e1b'
00261   _request_class  = ConnectHubRequest
00262   _response_class = ConnectHubResponse
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


gateway_comms
Author(s): Jihoon
autogenerated on Wed Nov 21 2012 15:02:06