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