_SetDataRate.py
Go to the documentation of this file.
00001 """autogenerated by genpy from cob_phidgets/SetDataRateRequest.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 SetDataRateRequest(genpy.Message):
00009   _md5sum = "2fe4d4dafc6b478c7e506a02543a3197"
00010   _type = "cob_phidgets/SetDataRateRequest"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """int8 index
00013 uint16 data_rate
00014 
00015 
00016 """
00017   __slots__ = ['index','data_rate']
00018   _slot_types = ['int8','uint16']
00019 
00020   def __init__(self, *args, **kwds):
00021     """
00022     Constructor. Any message fields that are implicitly/explicitly
00023     set to None will be assigned a default value. The recommend
00024     use is keyword arguments as this is more robust to future message
00025     changes.  You cannot mix in-order arguments and keyword arguments.
00026 
00027     The available fields are:
00028        index,data_rate
00029 
00030     :param args: complete set of field values, in .msg order
00031     :param kwds: use keyword arguments corresponding to message field names
00032     to set specific fields.
00033     """
00034     if args or kwds:
00035       super(SetDataRateRequest, self).__init__(*args, **kwds)
00036       #message fields cannot be None, assign default values for those that are
00037       if self.index is None:
00038         self.index = 0
00039       if self.data_rate is None:
00040         self.data_rate = 0
00041     else:
00042       self.index = 0
00043       self.data_rate = 0
00044 
00045   def _get_types(self):
00046     """
00047     internal API method
00048     """
00049     return self._slot_types
00050 
00051   def serialize(self, buff):
00052     """
00053     serialize message into buffer
00054     :param buff: buffer, ``StringIO``
00055     """
00056     try:
00057       _x = self
00058       buff.write(_struct_bH.pack(_x.index, _x.data_rate))
00059     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00060     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00061 
00062   def deserialize(self, str):
00063     """
00064     unpack serialized message in str into this message instance
00065     :param str: byte array of serialized message, ``str``
00066     """
00067     try:
00068       end = 0
00069       _x = self
00070       start = end
00071       end += 3
00072       (_x.index, _x.data_rate,) = _struct_bH.unpack(str[start:end])
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_bH.pack(_x.index, _x.data_rate))
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 += 3
00101       (_x.index, _x.data_rate,) = _struct_bH.unpack(str[start:end])
00102       return self
00103     except struct.error as e:
00104       raise genpy.DeserializationError(e) #most likely buffer underfill
00105 
00106 _struct_I = genpy.struct_I
00107 _struct_bH = struct.Struct("<bH")
00108 """autogenerated by genpy from cob_phidgets/SetDataRateResponse.msg. Do not edit."""
00109 import sys
00110 python3 = True if sys.hexversion > 0x03000000 else False
00111 import genpy
00112 import struct
00113 
00114 
00115 class SetDataRateResponse(genpy.Message):
00116   _md5sum = "d41d8cd98f00b204e9800998ecf8427e"
00117   _type = "cob_phidgets/SetDataRateResponse"
00118   _has_header = False #flag to mark the presence of a Header object
00119   _full_text = """
00120 """
00121   __slots__ = []
00122   _slot_types = []
00123 
00124   def __init__(self, *args, **kwds):
00125     """
00126     Constructor. Any message fields that are implicitly/explicitly
00127     set to None will be assigned a default value. The recommend
00128     use is keyword arguments as this is more robust to future message
00129     changes.  You cannot mix in-order arguments and keyword arguments.
00130 
00131     The available fields are:
00132        
00133 
00134     :param args: complete set of field values, in .msg order
00135     :param kwds: use keyword arguments corresponding to message field names
00136     to set specific fields.
00137     """
00138     if args or kwds:
00139       super(SetDataRateResponse, self).__init__(*args, **kwds)
00140 
00141   def _get_types(self):
00142     """
00143     internal API method
00144     """
00145     return self._slot_types
00146 
00147   def serialize(self, buff):
00148     """
00149     serialize message into buffer
00150     :param buff: buffer, ``StringIO``
00151     """
00152     try:
00153       pass
00154     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00155     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00156 
00157   def deserialize(self, str):
00158     """
00159     unpack serialized message in str into this message instance
00160     :param str: byte array of serialized message, ``str``
00161     """
00162     try:
00163       end = 0
00164       return self
00165     except struct.error as e:
00166       raise genpy.DeserializationError(e) #most likely buffer underfill
00167 
00168 
00169   def serialize_numpy(self, buff, numpy):
00170     """
00171     serialize message with numpy array types into buffer
00172     :param buff: buffer, ``StringIO``
00173     :param numpy: numpy python module
00174     """
00175     try:
00176       pass
00177     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00178     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00179 
00180   def deserialize_numpy(self, str, numpy):
00181     """
00182     unpack serialized message in str into this message instance using numpy for array types
00183     :param str: byte array of serialized message, ``str``
00184     :param numpy: numpy python module
00185     """
00186     try:
00187       end = 0
00188       return self
00189     except struct.error as e:
00190       raise genpy.DeserializationError(e) #most likely buffer underfill
00191 
00192 _struct_I = genpy.struct_I
00193 class SetDataRate(object):
00194   _type          = 'cob_phidgets/SetDataRate'
00195   _md5sum = '2fe4d4dafc6b478c7e506a02543a3197'
00196   _request_class  = SetDataRateRequest
00197   _response_class = SetDataRateResponse


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