Package create_node :: Package srv :: Module _SetDigitalOutputs
[frames] | no frames]

Source Code for Module create_node.srv._SetDigitalOutputs

  1  # This Python file uses the following encoding: utf-8 
  2  """autogenerated by genpy from create_node/SetDigitalOutputsRequest.msg. Do not edit.""" 
  3  import sys 
  4  python3 = True if sys.hexversion > 0x03000000 else False 
  5  import genpy 
  6  import struct 
  7   
  8   
9 -class SetDigitalOutputsRequest(genpy.Message):
10 _md5sum = "95ef1ce60d04abfe27bea339a6261f29" 11 _type = "create_node/SetDigitalOutputsRequest" 12 _has_header = False #flag to mark the presence of a Header object 13 _full_text = """uint8 digital_out_0 14 uint8 digital_out_1 15 uint8 digital_out_2 16 """ 17 __slots__ = ['digital_out_0','digital_out_1','digital_out_2'] 18 _slot_types = ['uint8','uint8','uint8'] 19
20 - def __init__(self, *args, **kwds):
21 """ 22 Constructor. Any message fields that are implicitly/explicitly 23 set to None will be assigned a default value. The recommend 24 use is keyword arguments as this is more robust to future message 25 changes. You cannot mix in-order arguments and keyword arguments. 26 27 The available fields are: 28 digital_out_0,digital_out_1,digital_out_2 29 30 :param args: complete set of field values, in .msg order 31 :param kwds: use keyword arguments corresponding to message field names 32 to set specific fields. 33 """ 34 if args or kwds: 35 super(SetDigitalOutputsRequest, self).__init__(*args, **kwds) 36 #message fields cannot be None, assign default values for those that are 37 if self.digital_out_0 is None: 38 self.digital_out_0 = 0 39 if self.digital_out_1 is None: 40 self.digital_out_1 = 0 41 if self.digital_out_2 is None: 42 self.digital_out_2 = 0 43 else: 44 self.digital_out_0 = 0 45 self.digital_out_1 = 0 46 self.digital_out_2 = 0
47
48 - def _get_types(self):
49 """ 50 internal API method 51 """ 52 return self._slot_types
53
54 - def serialize(self, buff):
55 """ 56 serialize message into buffer 57 :param buff: buffer, ``StringIO`` 58 """ 59 try: 60 _x = self 61 buff.write(_get_struct_3B().pack(_x.digital_out_0, _x.digital_out_1, _x.digital_out_2)) 62 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 63 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
64
65 - def deserialize(self, str):
66 """ 67 unpack serialized message in str into this message instance 68 :param str: byte array of serialized message, ``str`` 69 """ 70 try: 71 end = 0 72 _x = self 73 start = end 74 end += 3 75 (_x.digital_out_0, _x.digital_out_1, _x.digital_out_2,) = _get_struct_3B().unpack(str[start:end]) 76 return self 77 except struct.error as e: 78 raise genpy.DeserializationError(e) #most likely buffer underfill
79 80
81 - def serialize_numpy(self, buff, numpy):
82 """ 83 serialize message with numpy array types into buffer 84 :param buff: buffer, ``StringIO`` 85 :param numpy: numpy python module 86 """ 87 try: 88 _x = self 89 buff.write(_get_struct_3B().pack(_x.digital_out_0, _x.digital_out_1, _x.digital_out_2)) 90 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 91 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
92
93 - def deserialize_numpy(self, str, numpy):
94 """ 95 unpack serialized message in str into this message instance using numpy for array types 96 :param str: byte array of serialized message, ``str`` 97 :param numpy: numpy python module 98 """ 99 try: 100 end = 0 101 _x = self 102 start = end 103 end += 3 104 (_x.digital_out_0, _x.digital_out_1, _x.digital_out_2,) = _get_struct_3B().unpack(str[start:end]) 105 return self 106 except struct.error as e: 107 raise genpy.DeserializationError(e) #most likely buffer underfill
108 109 _struct_I = genpy.struct_I
110 -def _get_struct_I():
111 global _struct_I 112 return _struct_I
113 _struct_3B = None
114 -def _get_struct_3B():
115 global _struct_3B 116 if _struct_3B is None: 117 _struct_3B = struct.Struct("<3B") 118 return _struct_3B
119 # This Python file uses the following encoding: utf-8 120 """autogenerated by genpy from create_node/SetDigitalOutputsResponse.msg. Do not edit.""" 121 import sys 122 python3 = True if sys.hexversion > 0x03000000 else False 123 import genpy 124 import struct 125 126
127 -class SetDigitalOutputsResponse(genpy.Message):
128 _md5sum = "89bb254424e4cffedbf494e7b0ddbfea" 129 _type = "create_node/SetDigitalOutputsResponse" 130 _has_header = False #flag to mark the presence of a Header object 131 _full_text = """bool done 132 """ 133 __slots__ = ['done'] 134 _slot_types = ['bool'] 135
136 - def __init__(self, *args, **kwds):
137 """ 138 Constructor. Any message fields that are implicitly/explicitly 139 set to None will be assigned a default value. The recommend 140 use is keyword arguments as this is more robust to future message 141 changes. You cannot mix in-order arguments and keyword arguments. 142 143 The available fields are: 144 done 145 146 :param args: complete set of field values, in .msg order 147 :param kwds: use keyword arguments corresponding to message field names 148 to set specific fields. 149 """ 150 if args or kwds: 151 super(SetDigitalOutputsResponse, self).__init__(*args, **kwds) 152 #message fields cannot be None, assign default values for those that are 153 if self.done is None: 154 self.done = False 155 else: 156 self.done = False
157
158 - def _get_types(self):
159 """ 160 internal API method 161 """ 162 return self._slot_types
163
164 - def serialize(self, buff):
165 """ 166 serialize message into buffer 167 :param buff: buffer, ``StringIO`` 168 """ 169 try: 170 buff.write(_get_struct_B().pack(self.done)) 171 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 172 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
173
174 - def deserialize(self, str):
175 """ 176 unpack serialized message in str into this message instance 177 :param str: byte array of serialized message, ``str`` 178 """ 179 try: 180 end = 0 181 start = end 182 end += 1 183 (self.done,) = _get_struct_B().unpack(str[start:end]) 184 self.done = bool(self.done) 185 return self 186 except struct.error as e: 187 raise genpy.DeserializationError(e) #most likely buffer underfill
188 189
190 - def serialize_numpy(self, buff, numpy):
191 """ 192 serialize message with numpy array types into buffer 193 :param buff: buffer, ``StringIO`` 194 :param numpy: numpy python module 195 """ 196 try: 197 buff.write(_get_struct_B().pack(self.done)) 198 except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(locals().get('_x', self))))) 199 except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(locals().get('_x', self)))))
200
201 - def deserialize_numpy(self, str, numpy):
202 """ 203 unpack serialized message in str into this message instance using numpy for array types 204 :param str: byte array of serialized message, ``str`` 205 :param numpy: numpy python module 206 """ 207 try: 208 end = 0 209 start = end 210 end += 1 211 (self.done,) = _get_struct_B().unpack(str[start:end]) 212 self.done = bool(self.done) 213 return self 214 except struct.error as e: 215 raise genpy.DeserializationError(e) #most likely buffer underfill
216 217 _struct_I = genpy.struct_I
218 -def _get_struct_I():
219 global _struct_I 220 return _struct_I
221 _struct_B = None
222 -def _get_struct_B():
223 global _struct_B 224 if _struct_B is None: 225 _struct_B = struct.Struct("<B") 226 return _struct_B
227 -class SetDigitalOutputs(object):
228 _type = 'create_node/SetDigitalOutputs' 229 _md5sum = '3e43640171aa67a865fe4990d6959f42' 230 _request_class = SetDigitalOutputsRequest 231 _response_class = SetDigitalOutputsResponse
232