00001 """autogenerated by genpy from concert_msgs/PlatformInfo.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 PlatformInfo(genpy.Message):
00009 _md5sum = "b7eecb507ba2be3745396d9bffd407ef"
00010 _type = "concert_msgs/PlatformInfo"
00011 _has_header = False
00012 _full_text = """# Provides platform details from the app manager.
00013 #
00014 # Valid string constants are provided by concert_msgs/Constants.msg
00015
00016 string platform
00017 string system
00018 string robot
00019 string name
00020
00021 """
00022 __slots__ = ['platform','system','robot','name']
00023 _slot_types = ['string','string','string','string']
00024
00025 def __init__(self, *args, **kwds):
00026 """
00027 Constructor. Any message fields that are implicitly/explicitly
00028 set to None will be assigned a default value. The recommend
00029 use is keyword arguments as this is more robust to future message
00030 changes. You cannot mix in-order arguments and keyword arguments.
00031
00032 The available fields are:
00033 platform,system,robot,name
00034
00035 :param args: complete set of field values, in .msg order
00036 :param kwds: use keyword arguments corresponding to message field names
00037 to set specific fields.
00038 """
00039 if args or kwds:
00040 super(PlatformInfo, self).__init__(*args, **kwds)
00041
00042 if self.platform is None:
00043 self.platform = ''
00044 if self.system is None:
00045 self.system = ''
00046 if self.robot is None:
00047 self.robot = ''
00048 if self.name is None:
00049 self.name = ''
00050 else:
00051 self.platform = ''
00052 self.system = ''
00053 self.robot = ''
00054 self.name = ''
00055
00056 def _get_types(self):
00057 """
00058 internal API method
00059 """
00060 return self._slot_types
00061
00062 def serialize(self, buff):
00063 """
00064 serialize message into buffer
00065 :param buff: buffer, ``StringIO``
00066 """
00067 try:
00068 _x = self.platform
00069 length = len(_x)
00070 if python3 or type(_x) == unicode:
00071 _x = _x.encode('utf-8')
00072 length = len(_x)
00073 buff.write(struct.pack('<I%ss'%length, length, _x))
00074 _x = self.system
00075 length = len(_x)
00076 if python3 or type(_x) == unicode:
00077 _x = _x.encode('utf-8')
00078 length = len(_x)
00079 buff.write(struct.pack('<I%ss'%length, length, _x))
00080 _x = self.robot
00081 length = len(_x)
00082 if python3 or type(_x) == unicode:
00083 _x = _x.encode('utf-8')
00084 length = len(_x)
00085 buff.write(struct.pack('<I%ss'%length, length, _x))
00086 _x = self.name
00087 length = len(_x)
00088 if python3 or type(_x) == unicode:
00089 _x = _x.encode('utf-8')
00090 length = len(_x)
00091 buff.write(struct.pack('<I%ss'%length, length, _x))
00092 except struct.error as se: self._check_types(se)
00093 except TypeError as te: self._check_types(te)
00094
00095 def deserialize(self, str):
00096 """
00097 unpack serialized message in str into this message instance
00098 :param str: byte array of serialized message, ``str``
00099 """
00100 try:
00101 end = 0
00102 start = end
00103 end += 4
00104 (length,) = _struct_I.unpack(str[start:end])
00105 start = end
00106 end += length
00107 if python3:
00108 self.platform = str[start:end].decode('utf-8')
00109 else:
00110 self.platform = str[start:end]
00111 start = end
00112 end += 4
00113 (length,) = _struct_I.unpack(str[start:end])
00114 start = end
00115 end += length
00116 if python3:
00117 self.system = str[start:end].decode('utf-8')
00118 else:
00119 self.system = str[start:end]
00120 start = end
00121 end += 4
00122 (length,) = _struct_I.unpack(str[start:end])
00123 start = end
00124 end += length
00125 if python3:
00126 self.robot = str[start:end].decode('utf-8')
00127 else:
00128 self.robot = str[start:end]
00129 start = end
00130 end += 4
00131 (length,) = _struct_I.unpack(str[start:end])
00132 start = end
00133 end += length
00134 if python3:
00135 self.name = str[start:end].decode('utf-8')
00136 else:
00137 self.name = str[start:end]
00138 return self
00139 except struct.error as e:
00140 raise genpy.DeserializationError(e)
00141
00142
00143 def serialize_numpy(self, buff, numpy):
00144 """
00145 serialize message with numpy array types into buffer
00146 :param buff: buffer, ``StringIO``
00147 :param numpy: numpy python module
00148 """
00149 try:
00150 _x = self.platform
00151 length = len(_x)
00152 if python3 or type(_x) == unicode:
00153 _x = _x.encode('utf-8')
00154 length = len(_x)
00155 buff.write(struct.pack('<I%ss'%length, length, _x))
00156 _x = self.system
00157 length = len(_x)
00158 if python3 or type(_x) == unicode:
00159 _x = _x.encode('utf-8')
00160 length = len(_x)
00161 buff.write(struct.pack('<I%ss'%length, length, _x))
00162 _x = self.robot
00163 length = len(_x)
00164 if python3 or type(_x) == unicode:
00165 _x = _x.encode('utf-8')
00166 length = len(_x)
00167 buff.write(struct.pack('<I%ss'%length, length, _x))
00168 _x = self.name
00169 length = len(_x)
00170 if python3 or type(_x) == unicode:
00171 _x = _x.encode('utf-8')
00172 length = len(_x)
00173 buff.write(struct.pack('<I%ss'%length, length, _x))
00174 except struct.error as se: self._check_types(se)
00175 except TypeError as te: self._check_types(te)
00176
00177 def deserialize_numpy(self, str, numpy):
00178 """
00179 unpack serialized message in str into this message instance using numpy for array types
00180 :param str: byte array of serialized message, ``str``
00181 :param numpy: numpy python module
00182 """
00183 try:
00184 end = 0
00185 start = end
00186 end += 4
00187 (length,) = _struct_I.unpack(str[start:end])
00188 start = end
00189 end += length
00190 if python3:
00191 self.platform = str[start:end].decode('utf-8')
00192 else:
00193 self.platform = str[start:end]
00194 start = end
00195 end += 4
00196 (length,) = _struct_I.unpack(str[start:end])
00197 start = end
00198 end += length
00199 if python3:
00200 self.system = str[start:end].decode('utf-8')
00201 else:
00202 self.system = str[start:end]
00203 start = end
00204 end += 4
00205 (length,) = _struct_I.unpack(str[start:end])
00206 start = end
00207 end += length
00208 if python3:
00209 self.robot = str[start:end].decode('utf-8')
00210 else:
00211 self.robot = str[start:end]
00212 start = end
00213 end += 4
00214 (length,) = _struct_I.unpack(str[start:end])
00215 start = end
00216 end += length
00217 if python3:
00218 self.name = str[start:end].decode('utf-8')
00219 else:
00220 self.name = str[start:end]
00221 return self
00222 except struct.error as e:
00223 raise genpy.DeserializationError(e)
00224
00225 _struct_I = genpy.struct_I