$search
00001 """autogenerated by genmsg_py from DigitalSetDirectionRequest.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class DigitalSetDirectionRequest(roslib.message.Message): 00007 _md5sum = "b10eff5e5e7e4623e1ee840cec92b372" 00008 _type = "ros_arduino_msgs/DigitalSetDirectionRequest" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """uint8 pin 00011 bool direction 00012 00013 """ 00014 __slots__ = ['pin','direction'] 00015 _slot_types = ['uint8','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 pin,direction 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(DigitalSetDirectionRequest, self).__init__(*args, **kwds) 00033 #message fields cannot be None, assign default values for those that are 00034 if self.pin is None: 00035 self.pin = 0 00036 if self.direction is None: 00037 self.direction = False 00038 else: 00039 self.pin = 0 00040 self.direction = 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_2B.pack(_x.pin, _x.direction)) 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 += 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 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_2B.pack(_x.pin, _x.direction)) 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 += 2 00105 (_x.pin, _x.direction,) = _struct_2B.unpack(str[start:end]) 00106 self.direction = bool(self.direction) 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_2B = struct.Struct("<2B") 00113 """autogenerated by genmsg_py from DigitalSetDirectionResponse.msg. Do not edit.""" 00114 import roslib.message 00115 import struct 00116 00117 00118 class DigitalSetDirectionResponse(roslib.message.Message): 00119 _md5sum = "d41d8cd98f00b204e9800998ecf8427e" 00120 _type = "ros_arduino_msgs/DigitalSetDirectionResponse" 00121 _has_header = False #flag to mark the presence of a Header object 00122 _full_text = """ 00123 00124 """ 00125 __slots__ = [] 00126 _slot_types = [] 00127 00128 def __init__(self, *args, **kwds): 00129 """ 00130 Constructor. Any message fields that are implicitly/explicitly 00131 set to None will be assigned a default value. The recommend 00132 use is keyword arguments as this is more robust to future message 00133 changes. You cannot mix in-order arguments and keyword arguments. 00134 00135 The available fields are: 00136 00137 00138 @param args: complete set of field values, in .msg order 00139 @param kwds: use keyword arguments corresponding to message field names 00140 to set specific fields. 00141 """ 00142 if args or kwds: 00143 super(DigitalSetDirectionResponse, self).__init__(*args, **kwds) 00144 00145 def _get_types(self): 00146 """ 00147 internal API method 00148 """ 00149 return self._slot_types 00150 00151 def serialize(self, buff): 00152 """ 00153 serialize message into buffer 00154 @param buff: buffer 00155 @type buff: StringIO 00156 """ 00157 try: 00158 pass 00159 except struct.error as se: self._check_types(se) 00160 except TypeError as te: self._check_types(te) 00161 00162 def deserialize(self, str): 00163 """ 00164 unpack serialized message in str into this message instance 00165 @param str: byte array of serialized message 00166 @type str: str 00167 """ 00168 try: 00169 end = 0 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 pass 00185 except struct.error as se: self._check_types(se) 00186 except TypeError as te: self._check_types(te) 00187 00188 def deserialize_numpy(self, str, numpy): 00189 """ 00190 unpack serialized message in str into this message instance using numpy for array types 00191 @param str: byte array of serialized message 00192 @type str: str 00193 @param numpy: numpy python module 00194 @type numpy: module 00195 """ 00196 try: 00197 end = 0 00198 return self 00199 except struct.error as e: 00200 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00201 00202 _struct_I = roslib.message.struct_I 00203 class DigitalSetDirection(roslib.message.ServiceDefinition): 00204 _type = 'ros_arduino_msgs/DigitalSetDirection' 00205 _md5sum = 'b10eff5e5e7e4623e1ee840cec92b372' 00206 _request_class = DigitalSetDirectionRequest 00207 _response_class = DigitalSetDirectionResponse