$search
00001 """autogenerated by genmsg_py from Network.msg. Do not edit.""" 00002 import roslib.message 00003 import struct 00004 00005 00006 class Network(roslib.message.Message): 00007 _md5sum = "b0854419660dc197dd94305843bee07f" 00008 _type = "wifi_ddwrt/Network" 00009 _has_header = False #flag to mark the presence of a Header object 00010 _full_text = """string macattr 00011 string essid 00012 int32 channel 00013 int32 rssi 00014 int32 noise 00015 int32 beacon 00016 00017 """ 00018 __slots__ = ['macattr','essid','channel','rssi','noise','beacon'] 00019 _slot_types = ['string','string','int32','int32','int32','int32'] 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 macattr,essid,channel,rssi,noise,beacon 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(Network, self).__init__(*args, **kwds) 00037 #message fields cannot be None, assign default values for those that are 00038 if self.macattr is None: 00039 self.macattr = '' 00040 if self.essid is None: 00041 self.essid = '' 00042 if self.channel is None: 00043 self.channel = 0 00044 if self.rssi is None: 00045 self.rssi = 0 00046 if self.noise is None: 00047 self.noise = 0 00048 if self.beacon is None: 00049 self.beacon = 0 00050 else: 00051 self.macattr = '' 00052 self.essid = '' 00053 self.channel = 0 00054 self.rssi = 0 00055 self.noise = 0 00056 self.beacon = 0 00057 00058 def _get_types(self): 00059 """ 00060 internal API method 00061 """ 00062 return self._slot_types 00063 00064 def serialize(self, buff): 00065 """ 00066 serialize message into buffer 00067 @param buff: buffer 00068 @type buff: StringIO 00069 """ 00070 try: 00071 _x = self.macattr 00072 length = len(_x) 00073 buff.write(struct.pack('<I%ss'%length, length, _x)) 00074 _x = self.essid 00075 length = len(_x) 00076 buff.write(struct.pack('<I%ss'%length, length, _x)) 00077 _x = self 00078 buff.write(_struct_4i.pack(_x.channel, _x.rssi, _x.noise, _x.beacon)) 00079 except struct.error as se: self._check_types(se) 00080 except TypeError as te: self._check_types(te) 00081 00082 def deserialize(self, str): 00083 """ 00084 unpack serialized message in str into this message instance 00085 @param str: byte array of serialized message 00086 @type str: str 00087 """ 00088 try: 00089 end = 0 00090 start = end 00091 end += 4 00092 (length,) = _struct_I.unpack(str[start:end]) 00093 start = end 00094 end += length 00095 self.macattr = str[start:end] 00096 start = end 00097 end += 4 00098 (length,) = _struct_I.unpack(str[start:end]) 00099 start = end 00100 end += length 00101 self.essid = str[start:end] 00102 _x = self 00103 start = end 00104 end += 16 00105 (_x.channel, _x.rssi, _x.noise, _x.beacon,) = _struct_4i.unpack(str[start:end]) 00106 return self 00107 except struct.error as e: 00108 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00109 00110 00111 def serialize_numpy(self, buff, numpy): 00112 """ 00113 serialize message with numpy array types into buffer 00114 @param buff: buffer 00115 @type buff: StringIO 00116 @param numpy: numpy python module 00117 @type numpy module 00118 """ 00119 try: 00120 _x = self.macattr 00121 length = len(_x) 00122 buff.write(struct.pack('<I%ss'%length, length, _x)) 00123 _x = self.essid 00124 length = len(_x) 00125 buff.write(struct.pack('<I%ss'%length, length, _x)) 00126 _x = self 00127 buff.write(_struct_4i.pack(_x.channel, _x.rssi, _x.noise, _x.beacon)) 00128 except struct.error as se: self._check_types(se) 00129 except TypeError as te: self._check_types(te) 00130 00131 def deserialize_numpy(self, str, numpy): 00132 """ 00133 unpack serialized message in str into this message instance using numpy for array types 00134 @param str: byte array of serialized message 00135 @type str: str 00136 @param numpy: numpy python module 00137 @type numpy: module 00138 """ 00139 try: 00140 end = 0 00141 start = end 00142 end += 4 00143 (length,) = _struct_I.unpack(str[start:end]) 00144 start = end 00145 end += length 00146 self.macattr = str[start:end] 00147 start = end 00148 end += 4 00149 (length,) = _struct_I.unpack(str[start:end]) 00150 start = end 00151 end += length 00152 self.essid = str[start:end] 00153 _x = self 00154 start = end 00155 end += 16 00156 (_x.channel, _x.rssi, _x.noise, _x.beacon,) = _struct_4i.unpack(str[start:end]) 00157 return self 00158 except struct.error as e: 00159 raise roslib.message.DeserializationError(e) #most likely buffer underfill 00160 00161 _struct_I = roslib.message.struct_I 00162 _struct_4i = struct.Struct("<4i")