_Close.py
Go to the documentation of this file.
00001 """autogenerated by genpy from shared_serial/Close.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 Close(genpy.Message):
00009   _md5sum = "82ff2df0785f8985963dadf1a996d34e"
00010   _type = "shared_serial/Close"
00011   _has_header = False #flag to mark the presence of a Header object
00012   _full_text = """# Release serial port lock.
00013 
00014 # Socket identifier from an earlier communication.
00015 uint32 socket
00016 
00017 """
00018   __slots__ = ['socket']
00019   _slot_types = ['uint32']
00020 
00021   def __init__(self, *args, **kwds):
00022     """
00023     Constructor. Any message fields that are implicitly/explicitly
00024     set to None will be assigned a default value. The recommend
00025     use is keyword arguments as this is more robust to future message
00026     changes.  You cannot mix in-order arguments and keyword arguments.
00027 
00028     The available fields are:
00029        socket
00030 
00031     :param args: complete set of field values, in .msg order
00032     :param kwds: use keyword arguments corresponding to message field names
00033     to set specific fields.
00034     """
00035     if args or kwds:
00036       super(Close, self).__init__(*args, **kwds)
00037       #message fields cannot be None, assign default values for those that are
00038       if self.socket is None:
00039         self.socket = 0
00040     else:
00041       self.socket = 0
00042 
00043   def _get_types(self):
00044     """
00045     internal API method
00046     """
00047     return self._slot_types
00048 
00049   def serialize(self, buff):
00050     """
00051     serialize message into buffer
00052     :param buff: buffer, ``StringIO``
00053     """
00054     try:
00055       buff.write(_struct_I.pack(self.socket))
00056     except struct.error as se: self._check_types(se)
00057     except TypeError as te: self._check_types(te)
00058 
00059   def deserialize(self, str):
00060     """
00061     unpack serialized message in str into this message instance
00062     :param str: byte array of serialized message, ``str``
00063     """
00064     try:
00065       end = 0
00066       start = end
00067       end += 4
00068       (self.socket,) = _struct_I.unpack(str[start:end])
00069       return self
00070     except struct.error as e:
00071       raise genpy.DeserializationError(e) #most likely buffer underfill
00072 
00073 
00074   def serialize_numpy(self, buff, numpy):
00075     """
00076     serialize message with numpy array types into buffer
00077     :param buff: buffer, ``StringIO``
00078     :param numpy: numpy python module
00079     """
00080     try:
00081       buff.write(_struct_I.pack(self.socket))
00082     except struct.error as se: self._check_types(se)
00083     except TypeError as te: self._check_types(te)
00084 
00085   def deserialize_numpy(self, str, numpy):
00086     """
00087     unpack serialized message in str into this message instance using numpy for array types
00088     :param str: byte array of serialized message, ``str``
00089     :param numpy: numpy python module
00090     """
00091     try:
00092       end = 0
00093       start = end
00094       end += 4
00095       (self.socket,) = _struct_I.unpack(str[start:end])
00096       return self
00097     except struct.error as e:
00098       raise genpy.DeserializationError(e) #most likely buffer underfill
00099 
00100 _struct_I = genpy.struct_I


shared_serial
Author(s): Wouter Caarls
autogenerated on Sun Jan 5 2014 11:06:47