Go to the documentation of this file.00001 """autogenerated by genpy from shared_serial/ConnectRequest.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 ConnectRequest(genpy.Message):
00009 _md5sum = "8e929ace7fd80dc265b8b96078f41e82"
00010 _type = "shared_serial/ConnectRequest"
00011 _has_header = False
00012 _full_text = """
00013
00014
00015 float32 timeout
00016
00017
00018 """
00019 __slots__ = ['timeout']
00020 _slot_types = ['float32']
00021
00022 def __init__(self, *args, **kwds):
00023 """
00024 Constructor. Any message fields that are implicitly/explicitly
00025 set to None will be assigned a default value. The recommend
00026 use is keyword arguments as this is more robust to future message
00027 changes. You cannot mix in-order arguments and keyword arguments.
00028
00029 The available fields are:
00030 timeout
00031
00032 :param args: complete set of field values, in .msg order
00033 :param kwds: use keyword arguments corresponding to message field names
00034 to set specific fields.
00035 """
00036 if args or kwds:
00037 super(ConnectRequest, self).__init__(*args, **kwds)
00038
00039 if self.timeout is None:
00040 self.timeout = 0.
00041 else:
00042 self.timeout = 0.
00043
00044 def _get_types(self):
00045 """
00046 internal API method
00047 """
00048 return self._slot_types
00049
00050 def serialize(self, buff):
00051 """
00052 serialize message into buffer
00053 :param buff: buffer, ``StringIO``
00054 """
00055 try:
00056 buff.write(_struct_f.pack(self.timeout))
00057 except struct.error as se: self._check_types(se)
00058 except TypeError as te: self._check_types(te)
00059
00060 def deserialize(self, str):
00061 """
00062 unpack serialized message in str into this message instance
00063 :param str: byte array of serialized message, ``str``
00064 """
00065 try:
00066 end = 0
00067 start = end
00068 end += 4
00069 (self.timeout,) = _struct_f.unpack(str[start:end])
00070 return self
00071 except struct.error as e:
00072 raise genpy.DeserializationError(e)
00073
00074
00075 def serialize_numpy(self, buff, numpy):
00076 """
00077 serialize message with numpy array types into buffer
00078 :param buff: buffer, ``StringIO``
00079 :param numpy: numpy python module
00080 """
00081 try:
00082 buff.write(_struct_f.pack(self.timeout))
00083 except struct.error as se: self._check_types(se)
00084 except TypeError as te: self._check_types(te)
00085
00086 def deserialize_numpy(self, str, numpy):
00087 """
00088 unpack serialized message in str into this message instance using numpy for array types
00089 :param str: byte array of serialized message, ``str``
00090 :param numpy: numpy python module
00091 """
00092 try:
00093 end = 0
00094 start = end
00095 end += 4
00096 (self.timeout,) = _struct_f.unpack(str[start:end])
00097 return self
00098 except struct.error as e:
00099 raise genpy.DeserializationError(e)
00100
00101 _struct_I = genpy.struct_I
00102 _struct_f = struct.Struct("<f")
00103 """autogenerated by genpy from shared_serial/ConnectResponse.msg. Do not edit."""
00104 import sys
00105 python3 = True if sys.hexversion > 0x03000000 else False
00106 import genpy
00107 import struct
00108
00109
00110 class ConnectResponse(genpy.Message):
00111 _md5sum = "89a3ab074876917505d8ad961102ef9f"
00112 _type = "shared_serial/ConnectResponse"
00113 _has_header = False
00114 _full_text = """
00115
00116 int32 socket
00117
00118
00119 """
00120 __slots__ = ['socket']
00121 _slot_types = ['int32']
00122
00123 def __init__(self, *args, **kwds):
00124 """
00125 Constructor. Any message fields that are implicitly/explicitly
00126 set to None will be assigned a default value. The recommend
00127 use is keyword arguments as this is more robust to future message
00128 changes. You cannot mix in-order arguments and keyword arguments.
00129
00130 The available fields are:
00131 socket
00132
00133 :param args: complete set of field values, in .msg order
00134 :param kwds: use keyword arguments corresponding to message field names
00135 to set specific fields.
00136 """
00137 if args or kwds:
00138 super(ConnectResponse, self).__init__(*args, **kwds)
00139
00140 if self.socket is None:
00141 self.socket = 0
00142 else:
00143 self.socket = 0
00144
00145 def _get_types(self):
00146 """
00147 internal API method
00148 """
00149 return self._slot_types
00150
00151 def serialize(self, buff):
00152 """
00153 serialize message into buffer
00154 :param buff: buffer, ``StringIO``
00155 """
00156 try:
00157 buff.write(_struct_i.pack(self.socket))
00158 except struct.error as se: self._check_types(se)
00159 except TypeError as te: self._check_types(te)
00160
00161 def deserialize(self, str):
00162 """
00163 unpack serialized message in str into this message instance
00164 :param str: byte array of serialized message, ``str``
00165 """
00166 try:
00167 end = 0
00168 start = end
00169 end += 4
00170 (self.socket,) = _struct_i.unpack(str[start:end])
00171 return self
00172 except struct.error as e:
00173 raise genpy.DeserializationError(e)
00174
00175
00176 def serialize_numpy(self, buff, numpy):
00177 """
00178 serialize message with numpy array types into buffer
00179 :param buff: buffer, ``StringIO``
00180 :param numpy: numpy python module
00181 """
00182 try:
00183 buff.write(_struct_i.pack(self.socket))
00184 except struct.error as se: self._check_types(se)
00185 except TypeError as te: self._check_types(te)
00186
00187 def deserialize_numpy(self, str, numpy):
00188 """
00189 unpack serialized message in str into this message instance using numpy for array types
00190 :param str: byte array of serialized message, ``str``
00191 :param numpy: numpy python module
00192 """
00193 try:
00194 end = 0
00195 start = end
00196 end += 4
00197 (self.socket,) = _struct_i.unpack(str[start:end])
00198 return self
00199 except struct.error as e:
00200 raise genpy.DeserializationError(e)
00201
00202 _struct_I = genpy.struct_I
00203 _struct_i = struct.Struct("<i")
00204 class Connect(object):
00205 _type = 'shared_serial/Connect'
00206 _md5sum = '0f077aa46d26c0b33419647f84d73b59'
00207 _request_class = ConnectRequest
00208 _response_class = ConnectResponse