$search
00001 """autogenerated by genmsg_py from UDPMultHeader.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class UDPMultHeader(roslib.message.Message): 00007 _md5sum = "1e14983195867c72000e1c09bfde0cd0" 00008 _type = "udpmulti_transport/UDPMultHeader" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string multicast_address 00011 uint32 port 00012 00013 """ 00014 __slots__ = ['multicast_address','port'] 00015 _slot_types = ['string','uint32'] 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 multicast_address,port 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(UDPMultHeader, self).__init__(*args, **kwds) 00033 #message fields cannot be None, assign default values for those that are 00034 if self.multicast_address is None: 00035 self.multicast_address = '' 00036 if self.port is None: 00037 self.port = 0 00038 else: 00039 self.multicast_address = '' 00040 self.port = 0 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.multicast_address 00056 length = len(_x) 00057 buff.write(struct.pack('<I%ss'%length, length, _x)) 00058 buff.write(_struct_I.pack(self.port)) 00059 except struct.error as se: self._check_types(se) 00060 except TypeError as te: self._check_types(te) 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 00066 @type str: str 00067 """ 00068 try: 00069 end = 0 00070 start = end 00071 end += 4 00072 (length,) = _struct_I.unpack(str[start:end]) 00073 start = end 00074 end += length 00075 self.multicast_address = str[start:end] 00076 start = end 00077 end += 4 00078 (self.port,) = _struct_I.unpack(str[start:end]) 00079 return self 00080 except struct.error as e: 00081 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00082 00083 00084 def serialize_numpy(self, buff, numpy): 00085 """ 00086 serialize message with numpy array types into buffer 00087 @param buff: buffer 00088 @type buff: StringIO 00089 @param numpy: numpy python module 00090 @type numpy module 00091 """ 00092 try: 00093 _x = self.multicast_address 00094 length = len(_x) 00095 buff.write(struct.pack('<I%ss'%length, length, _x)) 00096 buff.write(_struct_I.pack(self.port)) 00097 except struct.error as se: self._check_types(se) 00098 except TypeError as te: self._check_types(te) 00099 00100 def deserialize_numpy(self, str, numpy): 00101 """ 00102 unpack serialized message in str into this message instance using numpy for array types 00103 @param str: byte array of serialized message 00104 @type str: str 00105 @param numpy: numpy python module 00106 @type numpy: module 00107 """ 00108 try: 00109 end = 0 00110 start = end 00111 end += 4 00112 (length,) = _struct_I.unpack(str[start:end]) 00113 start = end 00114 end += length 00115 self.multicast_address = str[start:end] 00116 start = end 00117 end += 4 00118 (self.port,) = _struct_I.unpack(str[start:end]) 00119 return self 00120 except struct.error as e: 00121 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00122 00123 _struct_I = roslib.message.struct_I