$search
00001 """autogenerated by genmsg_py from GetPortStatusRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class GetPortStatusRequest(roslib.message.Message): 00007 _md5sum = "d41d8cd98f00b204e9800998ecf8427e" 00008 _type = "remote_power_manager/GetPortStatusRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """ 00011 """ 00012 __slots__ = [] 00013 _slot_types = [] 00014 00015 def __init__(self, *args, **kwds): 00016 """ 00017 Constructor. Any message fields that are implicitly/explicitly 00018 set to None will be assigned a default value. The recommend 00019 use is keyword arguments as this is more robust to future message 00020 changes. You cannot mix in-order arguments and keyword arguments. 00021 00022 The available fields are: 00023 00024 00025 @param args: complete set of field values, in .msg order 00026 @param kwds: use keyword arguments corresponding to message field names 00027 to set specific fields. 00028 """ 00029 if args or kwds: 00030 super(GetPortStatusRequest, self).__init__(*args, **kwds) 00031 00032 def _get_types(self): 00033 """ 00034 internal API method 00035 """ 00036 return self._slot_types 00037 00038 def serialize(self, buff): 00039 """ 00040 serialize message into buffer 00041 @param buff: buffer 00042 @type buff: StringIO 00043 """ 00044 try: 00045 pass 00046 except struct.error as se: self._check_types(se) 00047 except TypeError as te: self._check_types(te) 00048 00049 def deserialize(self, str): 00050 """ 00051 unpack serialized message in str into this message instance 00052 @param str: byte array of serialized message 00053 @type str: str 00054 """ 00055 try: 00056 end = 0 00057 return self 00058 except struct.error as e: 00059 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00060 00061 00062 def serialize_numpy(self, buff, numpy): 00063 """ 00064 serialize message with numpy array types into buffer 00065 @param buff: buffer 00066 @type buff: StringIO 00067 @param numpy: numpy python module 00068 @type numpy module 00069 """ 00070 try: 00071 pass 00072 except struct.error as se: self._check_types(se) 00073 except TypeError as te: self._check_types(te) 00074 00075 def deserialize_numpy(self, str, numpy): 00076 """ 00077 unpack serialized message in str into this message instance using numpy for array types 00078 @param str: byte array of serialized message 00079 @type str: str 00080 @param numpy: numpy python module 00081 @type numpy: module 00082 """ 00083 try: 00084 end = 0 00085 return self 00086 except struct.error as e: 00087 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00088 00089 _struct_I = roslib.message.struct_I 00090 """autogenerated by genmsg_py from GetPortStatusResponse.msg. Do not edit.""" 00091 import roslib.message 00092 import struct 00093 00094 import remote_power_manager.msg 00095 00096 class GetPortStatusResponse(roslib.message.Message): 00097 _md5sum = "66485f491f3b0ebd8d8a44d3918f421d" 00098 _type = "remote_power_manager/GetPortStatusResponse" 00099 _has_header = False #flag to mark the presence of a Header object 00100 _full_text = """RemotePowerPortStatus value 00101 00102 ================================================================================ 00103 MSG: remote_power_manager/RemotePowerPortStatus 00104 bool[] port_status 00105 00106 """ 00107 __slots__ = ['value'] 00108 _slot_types = ['remote_power_manager/RemotePowerPortStatus'] 00109 00110 def __init__(self, *args, **kwds): 00111 """ 00112 Constructor. Any message fields that are implicitly/explicitly 00113 set to None will be assigned a default value. The recommend 00114 use is keyword arguments as this is more robust to future message 00115 changes. You cannot mix in-order arguments and keyword arguments. 00116 00117 The available fields are: 00118 value 00119 00120 @param args: complete set of field values, in .msg order 00121 @param kwds: use keyword arguments corresponding to message field names 00122 to set specific fields. 00123 """ 00124 if args or kwds: 00125 super(GetPortStatusResponse, self).__init__(*args, **kwds) 00126 #message fields cannot be None, assign default values for those that are 00127 if self.value is None: 00128 self.value = remote_power_manager.msg.RemotePowerPortStatus() 00129 else: 00130 self.value = remote_power_manager.msg.RemotePowerPortStatus() 00131 00132 def _get_types(self): 00133 """ 00134 internal API method 00135 """ 00136 return self._slot_types 00137 00138 def serialize(self, buff): 00139 """ 00140 serialize message into buffer 00141 @param buff: buffer 00142 @type buff: StringIO 00143 """ 00144 try: 00145 length = len(self.value.port_status) 00146 buff.write(_struct_I.pack(length)) 00147 pattern = '<%sB'%length 00148 buff.write(struct.pack(pattern, *self.value.port_status)) 00149 except struct.error as se: self._check_types(se) 00150 except TypeError as te: self._check_types(te) 00151 00152 def deserialize(self, str): 00153 """ 00154 unpack serialized message in str into this message instance 00155 @param str: byte array of serialized message 00156 @type str: str 00157 """ 00158 try: 00159 if self.value is None: 00160 self.value = remote_power_manager.msg.RemotePowerPortStatus() 00161 end = 0 00162 start = end 00163 end += 4 00164 (length,) = _struct_I.unpack(str[start:end]) 00165 pattern = '<%sB'%length 00166 start = end 00167 end += struct.calcsize(pattern) 00168 self.value.port_status = struct.unpack(pattern, str[start:end]) 00169 self.value.port_status = map(bool, self.value.port_status) 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 length = len(self.value.port_status) 00185 buff.write(_struct_I.pack(length)) 00186 pattern = '<%sB'%length 00187 buff.write(self.value.port_status.tostring()) 00188 except struct.error as se: self._check_types(se) 00189 except TypeError as te: self._check_types(te) 00190 00191 def deserialize_numpy(self, str, numpy): 00192 """ 00193 unpack serialized message in str into this message instance using numpy for array types 00194 @param str: byte array of serialized message 00195 @type str: str 00196 @param numpy: numpy python module 00197 @type numpy: module 00198 """ 00199 try: 00200 if self.value is None: 00201 self.value = remote_power_manager.msg.RemotePowerPortStatus() 00202 end = 0 00203 start = end 00204 end += 4 00205 (length,) = _struct_I.unpack(str[start:end]) 00206 pattern = '<%sB'%length 00207 start = end 00208 end += struct.calcsize(pattern) 00209 self.value.port_status = numpy.frombuffer(str[start:end], dtype=numpy.bool, count=length) 00210 self.value.port_status = map(bool, self.value.port_status) 00211 return self 00212 except struct.error as e: 00213 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00214 00215 _struct_I = roslib.message.struct_I 00216 class GetPortStatus(roslib.message.ServiceDefinition): 00217 _type = 'remote_power_manager/GetPortStatus' 00218 _md5sum = '66485f491f3b0ebd8d8a44d3918f421d' 00219 _request_class = GetPortStatusRequest 00220 _response_class = GetPortStatusResponse