_DigitalSetDirection.py
Go to the documentation of this file.
00001 """autogenerated by genpy from ros_arduino_msgs/DigitalSetDirectionRequest.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 DigitalSetDirectionRequest(genpy.Message):
00009   _md5sum = "b10eff5e5e7e4623e1ee840cec92b372"
00010   _type = "ros_arduino_msgs/DigitalSetDirectionRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """uint8 pin
00013 bool direction
00014 
00015 """
00016   __slots__ = ['pin','direction']
00017   _slot_types = ['uint8','bool']
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        pin,direction
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(DigitalSetDirectionRequest, self).__init__(*args, **kwds)
00035       #message fields cannot be None, assign default values for those that are
00036       if self.pin is None:
00037         self.pin = 0
00038       if self.direction is None:
00039         self.direction = False
00040     else:
00041       self.pin = 0
00042       self.direction = False
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
00057       buff.write(_struct_2B.pack(_x.pin, _x.direction))
00058     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00059     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00060 
00061   def deserialize(self, str):
00062     """
00063     unpack serialized message in str into this message instance
00064     :param str: byte array of serialized message, ``str``
00065     """
00066     try:
00067       end = 0
00068       _x = self
00069       start = end
00070       end += 2
00071       (_x.pin, _x.direction,) = _struct_2B.unpack(str[start:end])
00072       self.direction = bool(self.direction)
00073       return self
00074     except struct.error as e:
00075       raise genpy.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, ``StringIO``
00082     :param numpy: numpy python module
00083     """
00084     try:
00085       _x = self
00086       buff.write(_struct_2B.pack(_x.pin, _x.direction))
00087     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00088     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00089 
00090   def deserialize_numpy(self, str, numpy):
00091     """
00092     unpack serialized message in str into this message instance using numpy for array types
00093     :param str: byte array of serialized message, ``str``
00094     :param numpy: numpy python module
00095     """
00096     try:
00097       end = 0
00098       _x = self
00099       start = end
00100       end += 2
00101       (_x.pin, _x.direction,) = _struct_2B.unpack(str[start:end])
00102       self.direction = bool(self.direction)
00103       return self
00104     except struct.error as e:
00105       raise genpy.DeserializationError(e) #most likely buffer underfill
00106 
00107 _struct_I = genpy.struct_I
00108 _struct_2B = struct.Struct("<2B")
00109 """autogenerated by genpy from ros_arduino_msgs/DigitalSetDirectionResponse.msg. Do not edit."""
00110 import sys
00111 python3 = True if sys.hexversion > 0x03000000 else False
00112 import genpy
00113 import struct
00114 
00115 
00116 class DigitalSetDirectionResponse(genpy.Message):
00117   _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00118   _type = "ros_arduino_msgs/DigitalSetDirectionResponse"
00119   _has_header = False #flag to mark the presence of a Header object
00120   _full_text = """
00121 
00122 """
00123   __slots__ = []
00124   _slot_types = []
00125 
00126   def __init__(self, *args, **kwds):
00127     """
00128     Constructor. Any message fields that are implicitly/explicitly
00129     set to None will be assigned a default value. The recommend
00130     use is keyword arguments as this is more robust to future message
00131     changes.  You cannot mix in-order arguments and keyword arguments.
00132 
00133     The available fields are:
00134        
00135 
00136     :param args: complete set of field values, in .msg order
00137     :param kwds: use keyword arguments corresponding to message field names
00138     to set specific fields.
00139     """
00140     if args or kwds:
00141       super(DigitalSetDirectionResponse, self).__init__(*args, **kwds)
00142 
00143   def _get_types(self):
00144     """
00145     internal API method
00146     """
00147     return self._slot_types
00148 
00149   def serialize(self, buff):
00150     """
00151     serialize message into buffer
00152     :param buff: buffer, ``StringIO``
00153     """
00154     try:
00155       pass
00156     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00157     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00158 
00159   def deserialize(self, str):
00160     """
00161     unpack serialized message in str into this message instance
00162     :param str: byte array of serialized message, ``str``
00163     """
00164     try:
00165       end = 0
00166       return self
00167     except struct.error as e:
00168       raise genpy.DeserializationError(e) #most likely buffer underfill
00169 
00170 
00171   def serialize_numpy(self, buff, numpy):
00172     """
00173     serialize message with numpy array types into buffer
00174     :param buff: buffer, ``StringIO``
00175     :param numpy: numpy python module
00176     """
00177     try:
00178       pass
00179     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00180     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00181 
00182   def deserialize_numpy(self, str, numpy):
00183     """
00184     unpack serialized message in str into this message instance using numpy for array types
00185     :param str: byte array of serialized message, ``str``
00186     :param numpy: numpy python module
00187     """
00188     try:
00189       end = 0
00190       return self
00191     except struct.error as e:
00192       raise genpy.DeserializationError(e) #most likely buffer underfill
00193 
00194 _struct_I = genpy.struct_I
00195 class DigitalSetDirection(object):
00196   _type          = 'ros_arduino_msgs/DigitalSetDirection'
00197   _md5sum = 'b10eff5e5e7e4623e1ee840cec92b372'
00198   _request_class  = DigitalSetDirectionRequest
00199   _response_class = DigitalSetDirectionResponse


ros_arduino_msgs
Author(s): Patrick Goebel
autogenerated on Mon Oct 6 2014 06:51:42