00001 """autogenerated by genmsg_py from AssociateGoal.msg. Do not edit."""
00002 import roslib.message
00003 import struct
00004
00005
00006 class AssociateGoal(roslib.message.Message):
00007 _md5sum = "c38a1e6906f8c27b31959e0b0a44e536"
00008 _type = "wpa_supplicant_node/AssociateGoal"
00009 _has_header = False
00010 _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00011 string ssid
00012 uint8[6] bssid
00013 #Bss bss
00014
00015 """
00016 __slots__ = ['ssid','bssid']
00017 _slot_types = ['string','uint8[6]']
00018
00019 def __init__(self, *args, **kwds):
00020 """
00021 Constructor. Any message fields that are implicitly/explicitly
00022 set to None will be assigned a default value. The recommend
00023 use is keyword arguments as this is more robust to future message
00024 changes. You cannot mix in-order arguments and keyword arguments.
00025
00026 The available fields are:
00027 ssid,bssid
00028
00029 @param args: complete set of field values, in .msg order
00030 @param kwds: use keyword arguments corresponding to message field names
00031 to set specific fields.
00032 """
00033 if args or kwds:
00034 super(AssociateGoal, self).__init__(*args, **kwds)
00035
00036 if self.ssid is None:
00037 self.ssid = ''
00038 if self.bssid is None:
00039 self.bssid = chr(0)*6
00040 else:
00041 self.ssid = ''
00042 self.bssid = chr(0)*6
00043
00044 def _get_types(self):
00045 """
00046 internal API method
00047 """
00048 return self._slot_types
00049
00050 def serialize(self, buff):
00051 """
00052 serialize message into buffer
00053 @param buff: buffer
00054 @type buff: StringIO
00055 """
00056 try:
00057 _x = self.ssid
00058 length = len(_x)
00059 buff.write(struct.pack('<I%ss'%length, length, _x))
00060 _x = self.bssid
00061
00062 if type(_x) in [list, tuple]:
00063 buff.write(_struct_6B.pack(*_x))
00064 else:
00065 buff.write(_struct_6s.pack(_x))
00066 except struct.error, se: self._check_types(se)
00067 except TypeError, te: self._check_types(te)
00068
00069 def deserialize(self, str):
00070 """
00071 unpack serialized message in str into this message instance
00072 @param str: byte array of serialized message
00073 @type str: str
00074 """
00075 try:
00076 end = 0
00077 start = end
00078 end += 4
00079 (length,) = _struct_I.unpack(str[start:end])
00080 start = end
00081 end += length
00082 self.ssid = str[start:end]
00083 start = end
00084 end += 6
00085 self.bssid = str[start:end]
00086 return self
00087 except struct.error, e:
00088 raise roslib.message.DeserializationError(e)
00089
00090
00091 def serialize_numpy(self, buff, numpy):
00092 """
00093 serialize message with numpy array types into buffer
00094 @param buff: buffer
00095 @type buff: StringIO
00096 @param numpy: numpy python module
00097 @type numpy module
00098 """
00099 try:
00100 _x = self.ssid
00101 length = len(_x)
00102 buff.write(struct.pack('<I%ss'%length, length, _x))
00103 _x = self.bssid
00104
00105 if type(_x) in [list, tuple]:
00106 buff.write(_struct_6B.pack(*_x))
00107 else:
00108 buff.write(_struct_6s.pack(_x))
00109 except struct.error, se: self._check_types(se)
00110 except TypeError, te: self._check_types(te)
00111
00112 def deserialize_numpy(self, str, numpy):
00113 """
00114 unpack serialized message in str into this message instance using numpy for array types
00115 @param str: byte array of serialized message
00116 @type str: str
00117 @param numpy: numpy python module
00118 @type numpy: module
00119 """
00120 try:
00121 end = 0
00122 start = end
00123 end += 4
00124 (length,) = _struct_I.unpack(str[start:end])
00125 start = end
00126 end += length
00127 self.ssid = str[start:end]
00128 start = end
00129 end += 6
00130 self.bssid = str[start:end]
00131 return self
00132 except struct.error, e:
00133 raise roslib.message.DeserializationError(e)
00134
00135 _struct_I = roslib.message.struct_I
00136 _struct_6B = struct.Struct("<6B")
00137 _struct_6s = struct.Struct("<6s")