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


cob_phidgets
Author(s): Florian Weisshardt, Benjamin Maidel
autogenerated on Sun Oct 5 2014 23:10:20