_ScanAction.py
Go to the documentation of this file.
00001 """autogenerated by genpy from wpa_supplicant_node/ScanAction.msg. Do not edit."""
00002 import sys
00003 python3 = True if sys.hexversion > 0x03000000 else False
00004 import genpy
00005 import struct
00006 
00007 import wpa_supplicant_node.msg
00008 import genpy
00009 import actionlib_msgs.msg
00010 import std_msgs.msg
00011 
00012 class ScanAction(genpy.Message):
00013   _md5sum = "1b2a029a7de39475195700d742a0f593"
00014   _type = "wpa_supplicant_node/ScanAction"
00015   _has_header = False #flag to mark the presence of a Header object
00016   _full_text = """# ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00017 
00018 ScanActionGoal action_goal
00019 ScanActionResult action_result
00020 ScanActionFeedback action_feedback
00021 
00022 ================================================================================
00023 MSG: wpa_supplicant_node/ScanActionGoal
00024 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00025 
00026 Header header
00027 actionlib_msgs/GoalID goal_id
00028 ScanGoal goal
00029 
00030 ================================================================================
00031 MSG: std_msgs/Header
00032 # Standard metadata for higher-level stamped data types.
00033 # This is generally used to communicate timestamped data 
00034 # in a particular coordinate frame.
00035 # 
00036 # sequence ID: consecutively increasing ID 
00037 uint32 seq
00038 #Two-integer timestamp that is expressed as:
00039 # * stamp.secs: seconds (stamp_secs) since epoch
00040 # * stamp.nsecs: nanoseconds since stamp_secs
00041 # time-handling sugar is provided by the client library
00042 time stamp
00043 #Frame this data is associated with
00044 # 0: no frame
00045 # 1: global frame
00046 string frame_id
00047 
00048 ================================================================================
00049 MSG: actionlib_msgs/GoalID
00050 # The stamp should store the time at which this goal was requested.
00051 # It is used by an action server when it tries to preempt all
00052 # goals that were requested before a certain time
00053 time stamp
00054 
00055 # The id provides a way to associate feedback and
00056 # result message with specific goal requests. The id
00057 # specified must be unique.
00058 string id
00059 
00060 
00061 ================================================================================
00062 MSG: wpa_supplicant_node/ScanGoal
00063 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00064 string[] ssids # Ssids to scan
00065 int32[] frequencies # Channels to scan in MHz
00066 
00067 ================================================================================
00068 MSG: wpa_supplicant_node/ScanActionResult
00069 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00070 
00071 Header header
00072 actionlib_msgs/GoalStatus status
00073 ScanResult result
00074 
00075 ================================================================================
00076 MSG: actionlib_msgs/GoalStatus
00077 GoalID goal_id
00078 uint8 status
00079 uint8 PENDING         = 0   # The goal has yet to be processed by the action server
00080 uint8 ACTIVE          = 1   # The goal is currently being processed by the action server
00081 uint8 PREEMPTED       = 2   # The goal received a cancel request after it started executing
00082                             #   and has since completed its execution (Terminal State)
00083 uint8 SUCCEEDED       = 3   # The goal was achieved successfully by the action server (Terminal State)
00084 uint8 ABORTED         = 4   # The goal was aborted during execution by the action server due
00085                             #    to some failure (Terminal State)
00086 uint8 REJECTED        = 5   # The goal was rejected by the action server without being processed,
00087                             #    because the goal was unattainable or invalid (Terminal State)
00088 uint8 PREEMPTING      = 6   # The goal received a cancel request after it started executing
00089                             #    and has not yet completed execution
00090 uint8 RECALLING       = 7   # The goal received a cancel request before it started executing,
00091                             #    but the action server has not yet confirmed that the goal is canceled
00092 uint8 RECALLED        = 8   # The goal received a cancel request before it started executing
00093                             #    and was successfully cancelled (Terminal State)
00094 uint8 LOST            = 9   # An action client can determine that a goal is LOST. This should not be
00095                             #    sent over the wire by an action server
00096 
00097 #Allow for the user to associate a string with GoalStatus for debugging
00098 string text
00099 
00100 
00101 ================================================================================
00102 MSG: wpa_supplicant_node/ScanResult
00103 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00104 #int32 SUCCESS = 0
00105 #int32 TOO_MANY_SSIDS = 1
00106 #int32 TOO_MANY_CHANNELS = 2
00107 #int32 SCAN_REQUEST_FAILED = 3
00108 #int32 SCAN_REQUEST_TIMED_OUT = 4
00109 #
00110 bool success
00111 Bss[] bss
00112 
00113 ================================================================================
00114 MSG: wpa_supplicant_node/Bss
00115 time stamp
00116 string ssid
00117 uint8[6] bssid
00118 int32 frequency # In MHz
00119 int16 beacon_interval
00120 int16 capabilities
00121 int32 quality
00122 int32 noise
00123 int32 level
00124 SecurityProperties wpa
00125 SecurityProperties rsn
00126 
00127 #InformationElement []ies
00128 #InformationElement []beacon_ies
00129 # flags
00130 # tsf
00131 # age
00132 
00133 ================================================================================
00134 MSG: wpa_supplicant_node/SecurityProperties
00135 string[] key_mgmt
00136 string[] group
00137 string[] pairwise
00138 
00139 ================================================================================
00140 MSG: wpa_supplicant_node/ScanActionFeedback
00141 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00142 
00143 Header header
00144 actionlib_msgs/GoalStatus status
00145 ScanFeedback feedback
00146 
00147 ================================================================================
00148 MSG: wpa_supplicant_node/ScanFeedback
00149 # ====== DO NOT MODIFY! AUTOGENERATED FROM AN ACTION DEFINITION ======
00150 
00151 
00152 """
00153   __slots__ = ['action_goal','action_result','action_feedback']
00154   _slot_types = ['wpa_supplicant_node/ScanActionGoal','wpa_supplicant_node/ScanActionResult','wpa_supplicant_node/ScanActionFeedback']
00155 
00156   def __init__(self, *args, **kwds):
00157     """
00158     Constructor. Any message fields that are implicitly/explicitly
00159     set to None will be assigned a default value. The recommend
00160     use is keyword arguments as this is more robust to future message
00161     changes.  You cannot mix in-order arguments and keyword arguments.
00162 
00163     The available fields are:
00164        action_goal,action_result,action_feedback
00165 
00166     :param args: complete set of field values, in .msg order
00167     :param kwds: use keyword arguments corresponding to message field names
00168     to set specific fields.
00169     """
00170     if args or kwds:
00171       super(ScanAction, self).__init__(*args, **kwds)
00172       #message fields cannot be None, assign default values for those that are
00173       if self.action_goal is None:
00174         self.action_goal = wpa_supplicant_node.msg.ScanActionGoal()
00175       if self.action_result is None:
00176         self.action_result = wpa_supplicant_node.msg.ScanActionResult()
00177       if self.action_feedback is None:
00178         self.action_feedback = wpa_supplicant_node.msg.ScanActionFeedback()
00179     else:
00180       self.action_goal = wpa_supplicant_node.msg.ScanActionGoal()
00181       self.action_result = wpa_supplicant_node.msg.ScanActionResult()
00182       self.action_feedback = wpa_supplicant_node.msg.ScanActionFeedback()
00183 
00184   def _get_types(self):
00185     """
00186     internal API method
00187     """
00188     return self._slot_types
00189 
00190   def serialize(self, buff):
00191     """
00192     serialize message into buffer
00193     :param buff: buffer, ``StringIO``
00194     """
00195     try:
00196       _x = self
00197       buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00198       _x = self.action_goal.header.frame_id
00199       length = len(_x)
00200       if python3 or type(_x) == unicode:
00201         _x = _x.encode('utf-8')
00202         length = len(_x)
00203       buff.write(struct.pack('<I%ss'%length, length, _x))
00204       _x = self
00205       buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00206       _x = self.action_goal.goal_id.id
00207       length = len(_x)
00208       if python3 or type(_x) == unicode:
00209         _x = _x.encode('utf-8')
00210         length = len(_x)
00211       buff.write(struct.pack('<I%ss'%length, length, _x))
00212       length = len(self.action_goal.goal.ssids)
00213       buff.write(_struct_I.pack(length))
00214       for val1 in self.action_goal.goal.ssids:
00215         length = len(val1)
00216         if python3 or type(val1) == unicode:
00217           val1 = val1.encode('utf-8')
00218           length = len(val1)
00219         buff.write(struct.pack('<I%ss'%length, length, val1))
00220       length = len(self.action_goal.goal.frequencies)
00221       buff.write(_struct_I.pack(length))
00222       pattern = '<%si'%length
00223       buff.write(struct.pack(pattern, *self.action_goal.goal.frequencies))
00224       _x = self
00225       buff.write(_struct_3I.pack(_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00226       _x = self.action_result.header.frame_id
00227       length = len(_x)
00228       if python3 or type(_x) == unicode:
00229         _x = _x.encode('utf-8')
00230         length = len(_x)
00231       buff.write(struct.pack('<I%ss'%length, length, _x))
00232       _x = self
00233       buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00234       _x = self.action_result.status.goal_id.id
00235       length = len(_x)
00236       if python3 or type(_x) == unicode:
00237         _x = _x.encode('utf-8')
00238         length = len(_x)
00239       buff.write(struct.pack('<I%ss'%length, length, _x))
00240       buff.write(_struct_B.pack(self.action_result.status.status))
00241       _x = self.action_result.status.text
00242       length = len(_x)
00243       if python3 or type(_x) == unicode:
00244         _x = _x.encode('utf-8')
00245         length = len(_x)
00246       buff.write(struct.pack('<I%ss'%length, length, _x))
00247       buff.write(_struct_B.pack(self.action_result.result.success))
00248       length = len(self.action_result.result.bss)
00249       buff.write(_struct_I.pack(length))
00250       for val1 in self.action_result.result.bss:
00251         _v1 = val1.stamp
00252         _x = _v1
00253         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00254         _x = val1.ssid
00255         length = len(_x)
00256         if python3 or type(_x) == unicode:
00257           _x = _x.encode('utf-8')
00258           length = len(_x)
00259         buff.write(struct.pack('<I%ss'%length, length, _x))
00260         _x = val1.bssid
00261         # - if encoded as a list instead, serialize as bytes instead of string
00262         if type(_x) in [list, tuple]:
00263           buff.write(_struct_6B.pack(*_x))
00264         else:
00265           buff.write(_struct_6s.pack(_x))
00266         _x = val1
00267         buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00268         _v2 = val1.wpa
00269         length = len(_v2.key_mgmt)
00270         buff.write(_struct_I.pack(length))
00271         for val3 in _v2.key_mgmt:
00272           length = len(val3)
00273           if python3 or type(val3) == unicode:
00274             val3 = val3.encode('utf-8')
00275             length = len(val3)
00276           buff.write(struct.pack('<I%ss'%length, length, val3))
00277         length = len(_v2.group)
00278         buff.write(_struct_I.pack(length))
00279         for val3 in _v2.group:
00280           length = len(val3)
00281           if python3 or type(val3) == unicode:
00282             val3 = val3.encode('utf-8')
00283             length = len(val3)
00284           buff.write(struct.pack('<I%ss'%length, length, val3))
00285         length = len(_v2.pairwise)
00286         buff.write(_struct_I.pack(length))
00287         for val3 in _v2.pairwise:
00288           length = len(val3)
00289           if python3 or type(val3) == unicode:
00290             val3 = val3.encode('utf-8')
00291             length = len(val3)
00292           buff.write(struct.pack('<I%ss'%length, length, val3))
00293         _v3 = val1.rsn
00294         length = len(_v3.key_mgmt)
00295         buff.write(_struct_I.pack(length))
00296         for val3 in _v3.key_mgmt:
00297           length = len(val3)
00298           if python3 or type(val3) == unicode:
00299             val3 = val3.encode('utf-8')
00300             length = len(val3)
00301           buff.write(struct.pack('<I%ss'%length, length, val3))
00302         length = len(_v3.group)
00303         buff.write(_struct_I.pack(length))
00304         for val3 in _v3.group:
00305           length = len(val3)
00306           if python3 or type(val3) == unicode:
00307             val3 = val3.encode('utf-8')
00308             length = len(val3)
00309           buff.write(struct.pack('<I%ss'%length, length, val3))
00310         length = len(_v3.pairwise)
00311         buff.write(_struct_I.pack(length))
00312         for val3 in _v3.pairwise:
00313           length = len(val3)
00314           if python3 or type(val3) == unicode:
00315             val3 = val3.encode('utf-8')
00316             length = len(val3)
00317           buff.write(struct.pack('<I%ss'%length, length, val3))
00318       _x = self
00319       buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00320       _x = self.action_feedback.header.frame_id
00321       length = len(_x)
00322       if python3 or type(_x) == unicode:
00323         _x = _x.encode('utf-8')
00324         length = len(_x)
00325       buff.write(struct.pack('<I%ss'%length, length, _x))
00326       _x = self
00327       buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00328       _x = self.action_feedback.status.goal_id.id
00329       length = len(_x)
00330       if python3 or type(_x) == unicode:
00331         _x = _x.encode('utf-8')
00332         length = len(_x)
00333       buff.write(struct.pack('<I%ss'%length, length, _x))
00334       buff.write(_struct_B.pack(self.action_feedback.status.status))
00335       _x = self.action_feedback.status.text
00336       length = len(_x)
00337       if python3 or type(_x) == unicode:
00338         _x = _x.encode('utf-8')
00339         length = len(_x)
00340       buff.write(struct.pack('<I%ss'%length, length, _x))
00341     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00342     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00343 
00344   def deserialize(self, str):
00345     """
00346     unpack serialized message in str into this message instance
00347     :param str: byte array of serialized message, ``str``
00348     """
00349     try:
00350       if self.action_goal is None:
00351         self.action_goal = wpa_supplicant_node.msg.ScanActionGoal()
00352       if self.action_result is None:
00353         self.action_result = wpa_supplicant_node.msg.ScanActionResult()
00354       if self.action_feedback is None:
00355         self.action_feedback = wpa_supplicant_node.msg.ScanActionFeedback()
00356       end = 0
00357       _x = self
00358       start = end
00359       end += 12
00360       (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00361       start = end
00362       end += 4
00363       (length,) = _struct_I.unpack(str[start:end])
00364       start = end
00365       end += length
00366       if python3:
00367         self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00368       else:
00369         self.action_goal.header.frame_id = str[start:end]
00370       _x = self
00371       start = end
00372       end += 8
00373       (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00374       start = end
00375       end += 4
00376       (length,) = _struct_I.unpack(str[start:end])
00377       start = end
00378       end += length
00379       if python3:
00380         self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00381       else:
00382         self.action_goal.goal_id.id = str[start:end]
00383       start = end
00384       end += 4
00385       (length,) = _struct_I.unpack(str[start:end])
00386       self.action_goal.goal.ssids = []
00387       for i in range(0, length):
00388         start = end
00389         end += 4
00390         (length,) = _struct_I.unpack(str[start:end])
00391         start = end
00392         end += length
00393         if python3:
00394           val1 = str[start:end].decode('utf-8')
00395         else:
00396           val1 = str[start:end]
00397         self.action_goal.goal.ssids.append(val1)
00398       start = end
00399       end += 4
00400       (length,) = _struct_I.unpack(str[start:end])
00401       pattern = '<%si'%length
00402       start = end
00403       end += struct.calcsize(pattern)
00404       self.action_goal.goal.frequencies = struct.unpack(pattern, str[start:end])
00405       _x = self
00406       start = end
00407       end += 12
00408       (_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00409       start = end
00410       end += 4
00411       (length,) = _struct_I.unpack(str[start:end])
00412       start = end
00413       end += length
00414       if python3:
00415         self.action_result.header.frame_id = str[start:end].decode('utf-8')
00416       else:
00417         self.action_result.header.frame_id = str[start:end]
00418       _x = self
00419       start = end
00420       end += 8
00421       (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00422       start = end
00423       end += 4
00424       (length,) = _struct_I.unpack(str[start:end])
00425       start = end
00426       end += length
00427       if python3:
00428         self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00429       else:
00430         self.action_result.status.goal_id.id = str[start:end]
00431       start = end
00432       end += 1
00433       (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00434       start = end
00435       end += 4
00436       (length,) = _struct_I.unpack(str[start:end])
00437       start = end
00438       end += length
00439       if python3:
00440         self.action_result.status.text = str[start:end].decode('utf-8')
00441       else:
00442         self.action_result.status.text = str[start:end]
00443       start = end
00444       end += 1
00445       (self.action_result.result.success,) = _struct_B.unpack(str[start:end])
00446       self.action_result.result.success = bool(self.action_result.result.success)
00447       start = end
00448       end += 4
00449       (length,) = _struct_I.unpack(str[start:end])
00450       self.action_result.result.bss = []
00451       for i in range(0, length):
00452         val1 = wpa_supplicant_node.msg.Bss()
00453         _v4 = val1.stamp
00454         _x = _v4
00455         start = end
00456         end += 8
00457         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00458         start = end
00459         end += 4
00460         (length,) = _struct_I.unpack(str[start:end])
00461         start = end
00462         end += length
00463         if python3:
00464           val1.ssid = str[start:end].decode('utf-8')
00465         else:
00466           val1.ssid = str[start:end]
00467         start = end
00468         end += 6
00469         val1.bssid = str[start:end]
00470         _x = val1
00471         start = end
00472         end += 20
00473         (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00474         _v5 = val1.wpa
00475         start = end
00476         end += 4
00477         (length,) = _struct_I.unpack(str[start:end])
00478         _v5.key_mgmt = []
00479         for i in range(0, length):
00480           start = end
00481           end += 4
00482           (length,) = _struct_I.unpack(str[start:end])
00483           start = end
00484           end += length
00485           if python3:
00486             val3 = str[start:end].decode('utf-8')
00487           else:
00488             val3 = str[start:end]
00489           _v5.key_mgmt.append(val3)
00490         start = end
00491         end += 4
00492         (length,) = _struct_I.unpack(str[start:end])
00493         _v5.group = []
00494         for i in range(0, length):
00495           start = end
00496           end += 4
00497           (length,) = _struct_I.unpack(str[start:end])
00498           start = end
00499           end += length
00500           if python3:
00501             val3 = str[start:end].decode('utf-8')
00502           else:
00503             val3 = str[start:end]
00504           _v5.group.append(val3)
00505         start = end
00506         end += 4
00507         (length,) = _struct_I.unpack(str[start:end])
00508         _v5.pairwise = []
00509         for i in range(0, length):
00510           start = end
00511           end += 4
00512           (length,) = _struct_I.unpack(str[start:end])
00513           start = end
00514           end += length
00515           if python3:
00516             val3 = str[start:end].decode('utf-8')
00517           else:
00518             val3 = str[start:end]
00519           _v5.pairwise.append(val3)
00520         _v6 = val1.rsn
00521         start = end
00522         end += 4
00523         (length,) = _struct_I.unpack(str[start:end])
00524         _v6.key_mgmt = []
00525         for i in range(0, length):
00526           start = end
00527           end += 4
00528           (length,) = _struct_I.unpack(str[start:end])
00529           start = end
00530           end += length
00531           if python3:
00532             val3 = str[start:end].decode('utf-8')
00533           else:
00534             val3 = str[start:end]
00535           _v6.key_mgmt.append(val3)
00536         start = end
00537         end += 4
00538         (length,) = _struct_I.unpack(str[start:end])
00539         _v6.group = []
00540         for i in range(0, length):
00541           start = end
00542           end += 4
00543           (length,) = _struct_I.unpack(str[start:end])
00544           start = end
00545           end += length
00546           if python3:
00547             val3 = str[start:end].decode('utf-8')
00548           else:
00549             val3 = str[start:end]
00550           _v6.group.append(val3)
00551         start = end
00552         end += 4
00553         (length,) = _struct_I.unpack(str[start:end])
00554         _v6.pairwise = []
00555         for i in range(0, length):
00556           start = end
00557           end += 4
00558           (length,) = _struct_I.unpack(str[start:end])
00559           start = end
00560           end += length
00561           if python3:
00562             val3 = str[start:end].decode('utf-8')
00563           else:
00564             val3 = str[start:end]
00565           _v6.pairwise.append(val3)
00566         self.action_result.result.bss.append(val1)
00567       _x = self
00568       start = end
00569       end += 12
00570       (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00571       start = end
00572       end += 4
00573       (length,) = _struct_I.unpack(str[start:end])
00574       start = end
00575       end += length
00576       if python3:
00577         self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
00578       else:
00579         self.action_feedback.header.frame_id = str[start:end]
00580       _x = self
00581       start = end
00582       end += 8
00583       (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00584       start = end
00585       end += 4
00586       (length,) = _struct_I.unpack(str[start:end])
00587       start = end
00588       end += length
00589       if python3:
00590         self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
00591       else:
00592         self.action_feedback.status.goal_id.id = str[start:end]
00593       start = end
00594       end += 1
00595       (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
00596       start = end
00597       end += 4
00598       (length,) = _struct_I.unpack(str[start:end])
00599       start = end
00600       end += length
00601       if python3:
00602         self.action_feedback.status.text = str[start:end].decode('utf-8')
00603       else:
00604         self.action_feedback.status.text = str[start:end]
00605       return self
00606     except struct.error as e:
00607       raise genpy.DeserializationError(e) #most likely buffer underfill
00608 
00609 
00610   def serialize_numpy(self, buff, numpy):
00611     """
00612     serialize message with numpy array types into buffer
00613     :param buff: buffer, ``StringIO``
00614     :param numpy: numpy python module
00615     """
00616     try:
00617       _x = self
00618       buff.write(_struct_3I.pack(_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs))
00619       _x = self.action_goal.header.frame_id
00620       length = len(_x)
00621       if python3 or type(_x) == unicode:
00622         _x = _x.encode('utf-8')
00623         length = len(_x)
00624       buff.write(struct.pack('<I%ss'%length, length, _x))
00625       _x = self
00626       buff.write(_struct_2I.pack(_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs))
00627       _x = self.action_goal.goal_id.id
00628       length = len(_x)
00629       if python3 or type(_x) == unicode:
00630         _x = _x.encode('utf-8')
00631         length = len(_x)
00632       buff.write(struct.pack('<I%ss'%length, length, _x))
00633       length = len(self.action_goal.goal.ssids)
00634       buff.write(_struct_I.pack(length))
00635       for val1 in self.action_goal.goal.ssids:
00636         length = len(val1)
00637         if python3 or type(val1) == unicode:
00638           val1 = val1.encode('utf-8')
00639           length = len(val1)
00640         buff.write(struct.pack('<I%ss'%length, length, val1))
00641       length = len(self.action_goal.goal.frequencies)
00642       buff.write(_struct_I.pack(length))
00643       pattern = '<%si'%length
00644       buff.write(self.action_goal.goal.frequencies.tostring())
00645       _x = self
00646       buff.write(_struct_3I.pack(_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs))
00647       _x = self.action_result.header.frame_id
00648       length = len(_x)
00649       if python3 or type(_x) == unicode:
00650         _x = _x.encode('utf-8')
00651         length = len(_x)
00652       buff.write(struct.pack('<I%ss'%length, length, _x))
00653       _x = self
00654       buff.write(_struct_2I.pack(_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs))
00655       _x = self.action_result.status.goal_id.id
00656       length = len(_x)
00657       if python3 or type(_x) == unicode:
00658         _x = _x.encode('utf-8')
00659         length = len(_x)
00660       buff.write(struct.pack('<I%ss'%length, length, _x))
00661       buff.write(_struct_B.pack(self.action_result.status.status))
00662       _x = self.action_result.status.text
00663       length = len(_x)
00664       if python3 or type(_x) == unicode:
00665         _x = _x.encode('utf-8')
00666         length = len(_x)
00667       buff.write(struct.pack('<I%ss'%length, length, _x))
00668       buff.write(_struct_B.pack(self.action_result.result.success))
00669       length = len(self.action_result.result.bss)
00670       buff.write(_struct_I.pack(length))
00671       for val1 in self.action_result.result.bss:
00672         _v7 = val1.stamp
00673         _x = _v7
00674         buff.write(_struct_2I.pack(_x.secs, _x.nsecs))
00675         _x = val1.ssid
00676         length = len(_x)
00677         if python3 or type(_x) == unicode:
00678           _x = _x.encode('utf-8')
00679           length = len(_x)
00680         buff.write(struct.pack('<I%ss'%length, length, _x))
00681         _x = val1.bssid
00682         # - if encoded as a list instead, serialize as bytes instead of string
00683         if type(_x) in [list, tuple]:
00684           buff.write(_struct_6B.pack(*_x))
00685         else:
00686           buff.write(_struct_6s.pack(_x))
00687         _x = val1
00688         buff.write(_struct_i2h3i.pack(_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level))
00689         _v8 = val1.wpa
00690         length = len(_v8.key_mgmt)
00691         buff.write(_struct_I.pack(length))
00692         for val3 in _v8.key_mgmt:
00693           length = len(val3)
00694           if python3 or type(val3) == unicode:
00695             val3 = val3.encode('utf-8')
00696             length = len(val3)
00697           buff.write(struct.pack('<I%ss'%length, length, val3))
00698         length = len(_v8.group)
00699         buff.write(_struct_I.pack(length))
00700         for val3 in _v8.group:
00701           length = len(val3)
00702           if python3 or type(val3) == unicode:
00703             val3 = val3.encode('utf-8')
00704             length = len(val3)
00705           buff.write(struct.pack('<I%ss'%length, length, val3))
00706         length = len(_v8.pairwise)
00707         buff.write(_struct_I.pack(length))
00708         for val3 in _v8.pairwise:
00709           length = len(val3)
00710           if python3 or type(val3) == unicode:
00711             val3 = val3.encode('utf-8')
00712             length = len(val3)
00713           buff.write(struct.pack('<I%ss'%length, length, val3))
00714         _v9 = val1.rsn
00715         length = len(_v9.key_mgmt)
00716         buff.write(_struct_I.pack(length))
00717         for val3 in _v9.key_mgmt:
00718           length = len(val3)
00719           if python3 or type(val3) == unicode:
00720             val3 = val3.encode('utf-8')
00721             length = len(val3)
00722           buff.write(struct.pack('<I%ss'%length, length, val3))
00723         length = len(_v9.group)
00724         buff.write(_struct_I.pack(length))
00725         for val3 in _v9.group:
00726           length = len(val3)
00727           if python3 or type(val3) == unicode:
00728             val3 = val3.encode('utf-8')
00729             length = len(val3)
00730           buff.write(struct.pack('<I%ss'%length, length, val3))
00731         length = len(_v9.pairwise)
00732         buff.write(_struct_I.pack(length))
00733         for val3 in _v9.pairwise:
00734           length = len(val3)
00735           if python3 or type(val3) == unicode:
00736             val3 = val3.encode('utf-8')
00737             length = len(val3)
00738           buff.write(struct.pack('<I%ss'%length, length, val3))
00739       _x = self
00740       buff.write(_struct_3I.pack(_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs))
00741       _x = self.action_feedback.header.frame_id
00742       length = len(_x)
00743       if python3 or type(_x) == unicode:
00744         _x = _x.encode('utf-8')
00745         length = len(_x)
00746       buff.write(struct.pack('<I%ss'%length, length, _x))
00747       _x = self
00748       buff.write(_struct_2I.pack(_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs))
00749       _x = self.action_feedback.status.goal_id.id
00750       length = len(_x)
00751       if python3 or type(_x) == unicode:
00752         _x = _x.encode('utf-8')
00753         length = len(_x)
00754       buff.write(struct.pack('<I%ss'%length, length, _x))
00755       buff.write(_struct_B.pack(self.action_feedback.status.status))
00756       _x = self.action_feedback.status.text
00757       length = len(_x)
00758       if python3 or type(_x) == unicode:
00759         _x = _x.encode('utf-8')
00760         length = len(_x)
00761       buff.write(struct.pack('<I%ss'%length, length, _x))
00762     except struct.error as se: self._check_types(struct.error("%s: '%s' when writing '%s'" % (type(se), str(se), str(_x))))
00763     except TypeError as te: self._check_types(ValueError("%s: '%s' when writing '%s'" % (type(te), str(te), str(_x))))
00764 
00765   def deserialize_numpy(self, str, numpy):
00766     """
00767     unpack serialized message in str into this message instance using numpy for array types
00768     :param str: byte array of serialized message, ``str``
00769     :param numpy: numpy python module
00770     """
00771     try:
00772       if self.action_goal is None:
00773         self.action_goal = wpa_supplicant_node.msg.ScanActionGoal()
00774       if self.action_result is None:
00775         self.action_result = wpa_supplicant_node.msg.ScanActionResult()
00776       if self.action_feedback is None:
00777         self.action_feedback = wpa_supplicant_node.msg.ScanActionFeedback()
00778       end = 0
00779       _x = self
00780       start = end
00781       end += 12
00782       (_x.action_goal.header.seq, _x.action_goal.header.stamp.secs, _x.action_goal.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00783       start = end
00784       end += 4
00785       (length,) = _struct_I.unpack(str[start:end])
00786       start = end
00787       end += length
00788       if python3:
00789         self.action_goal.header.frame_id = str[start:end].decode('utf-8')
00790       else:
00791         self.action_goal.header.frame_id = str[start:end]
00792       _x = self
00793       start = end
00794       end += 8
00795       (_x.action_goal.goal_id.stamp.secs, _x.action_goal.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00796       start = end
00797       end += 4
00798       (length,) = _struct_I.unpack(str[start:end])
00799       start = end
00800       end += length
00801       if python3:
00802         self.action_goal.goal_id.id = str[start:end].decode('utf-8')
00803       else:
00804         self.action_goal.goal_id.id = str[start:end]
00805       start = end
00806       end += 4
00807       (length,) = _struct_I.unpack(str[start:end])
00808       self.action_goal.goal.ssids = []
00809       for i in range(0, length):
00810         start = end
00811         end += 4
00812         (length,) = _struct_I.unpack(str[start:end])
00813         start = end
00814         end += length
00815         if python3:
00816           val1 = str[start:end].decode('utf-8')
00817         else:
00818           val1 = str[start:end]
00819         self.action_goal.goal.ssids.append(val1)
00820       start = end
00821       end += 4
00822       (length,) = _struct_I.unpack(str[start:end])
00823       pattern = '<%si'%length
00824       start = end
00825       end += struct.calcsize(pattern)
00826       self.action_goal.goal.frequencies = numpy.frombuffer(str[start:end], dtype=numpy.int32, count=length)
00827       _x = self
00828       start = end
00829       end += 12
00830       (_x.action_result.header.seq, _x.action_result.header.stamp.secs, _x.action_result.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00831       start = end
00832       end += 4
00833       (length,) = _struct_I.unpack(str[start:end])
00834       start = end
00835       end += length
00836       if python3:
00837         self.action_result.header.frame_id = str[start:end].decode('utf-8')
00838       else:
00839         self.action_result.header.frame_id = str[start:end]
00840       _x = self
00841       start = end
00842       end += 8
00843       (_x.action_result.status.goal_id.stamp.secs, _x.action_result.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
00844       start = end
00845       end += 4
00846       (length,) = _struct_I.unpack(str[start:end])
00847       start = end
00848       end += length
00849       if python3:
00850         self.action_result.status.goal_id.id = str[start:end].decode('utf-8')
00851       else:
00852         self.action_result.status.goal_id.id = str[start:end]
00853       start = end
00854       end += 1
00855       (self.action_result.status.status,) = _struct_B.unpack(str[start:end])
00856       start = end
00857       end += 4
00858       (length,) = _struct_I.unpack(str[start:end])
00859       start = end
00860       end += length
00861       if python3:
00862         self.action_result.status.text = str[start:end].decode('utf-8')
00863       else:
00864         self.action_result.status.text = str[start:end]
00865       start = end
00866       end += 1
00867       (self.action_result.result.success,) = _struct_B.unpack(str[start:end])
00868       self.action_result.result.success = bool(self.action_result.result.success)
00869       start = end
00870       end += 4
00871       (length,) = _struct_I.unpack(str[start:end])
00872       self.action_result.result.bss = []
00873       for i in range(0, length):
00874         val1 = wpa_supplicant_node.msg.Bss()
00875         _v10 = val1.stamp
00876         _x = _v10
00877         start = end
00878         end += 8
00879         (_x.secs, _x.nsecs,) = _struct_2I.unpack(str[start:end])
00880         start = end
00881         end += 4
00882         (length,) = _struct_I.unpack(str[start:end])
00883         start = end
00884         end += length
00885         if python3:
00886           val1.ssid = str[start:end].decode('utf-8')
00887         else:
00888           val1.ssid = str[start:end]
00889         start = end
00890         end += 6
00891         val1.bssid = str[start:end]
00892         _x = val1
00893         start = end
00894         end += 20
00895         (_x.frequency, _x.beacon_interval, _x.capabilities, _x.quality, _x.noise, _x.level,) = _struct_i2h3i.unpack(str[start:end])
00896         _v11 = val1.wpa
00897         start = end
00898         end += 4
00899         (length,) = _struct_I.unpack(str[start:end])
00900         _v11.key_mgmt = []
00901         for i in range(0, length):
00902           start = end
00903           end += 4
00904           (length,) = _struct_I.unpack(str[start:end])
00905           start = end
00906           end += length
00907           if python3:
00908             val3 = str[start:end].decode('utf-8')
00909           else:
00910             val3 = str[start:end]
00911           _v11.key_mgmt.append(val3)
00912         start = end
00913         end += 4
00914         (length,) = _struct_I.unpack(str[start:end])
00915         _v11.group = []
00916         for i in range(0, length):
00917           start = end
00918           end += 4
00919           (length,) = _struct_I.unpack(str[start:end])
00920           start = end
00921           end += length
00922           if python3:
00923             val3 = str[start:end].decode('utf-8')
00924           else:
00925             val3 = str[start:end]
00926           _v11.group.append(val3)
00927         start = end
00928         end += 4
00929         (length,) = _struct_I.unpack(str[start:end])
00930         _v11.pairwise = []
00931         for i in range(0, length):
00932           start = end
00933           end += 4
00934           (length,) = _struct_I.unpack(str[start:end])
00935           start = end
00936           end += length
00937           if python3:
00938             val3 = str[start:end].decode('utf-8')
00939           else:
00940             val3 = str[start:end]
00941           _v11.pairwise.append(val3)
00942         _v12 = val1.rsn
00943         start = end
00944         end += 4
00945         (length,) = _struct_I.unpack(str[start:end])
00946         _v12.key_mgmt = []
00947         for i in range(0, length):
00948           start = end
00949           end += 4
00950           (length,) = _struct_I.unpack(str[start:end])
00951           start = end
00952           end += length
00953           if python3:
00954             val3 = str[start:end].decode('utf-8')
00955           else:
00956             val3 = str[start:end]
00957           _v12.key_mgmt.append(val3)
00958         start = end
00959         end += 4
00960         (length,) = _struct_I.unpack(str[start:end])
00961         _v12.group = []
00962         for i in range(0, length):
00963           start = end
00964           end += 4
00965           (length,) = _struct_I.unpack(str[start:end])
00966           start = end
00967           end += length
00968           if python3:
00969             val3 = str[start:end].decode('utf-8')
00970           else:
00971             val3 = str[start:end]
00972           _v12.group.append(val3)
00973         start = end
00974         end += 4
00975         (length,) = _struct_I.unpack(str[start:end])
00976         _v12.pairwise = []
00977         for i in range(0, length):
00978           start = end
00979           end += 4
00980           (length,) = _struct_I.unpack(str[start:end])
00981           start = end
00982           end += length
00983           if python3:
00984             val3 = str[start:end].decode('utf-8')
00985           else:
00986             val3 = str[start:end]
00987           _v12.pairwise.append(val3)
00988         self.action_result.result.bss.append(val1)
00989       _x = self
00990       start = end
00991       end += 12
00992       (_x.action_feedback.header.seq, _x.action_feedback.header.stamp.secs, _x.action_feedback.header.stamp.nsecs,) = _struct_3I.unpack(str[start:end])
00993       start = end
00994       end += 4
00995       (length,) = _struct_I.unpack(str[start:end])
00996       start = end
00997       end += length
00998       if python3:
00999         self.action_feedback.header.frame_id = str[start:end].decode('utf-8')
01000       else:
01001         self.action_feedback.header.frame_id = str[start:end]
01002       _x = self
01003       start = end
01004       end += 8
01005       (_x.action_feedback.status.goal_id.stamp.secs, _x.action_feedback.status.goal_id.stamp.nsecs,) = _struct_2I.unpack(str[start:end])
01006       start = end
01007       end += 4
01008       (length,) = _struct_I.unpack(str[start:end])
01009       start = end
01010       end += length
01011       if python3:
01012         self.action_feedback.status.goal_id.id = str[start:end].decode('utf-8')
01013       else:
01014         self.action_feedback.status.goal_id.id = str[start:end]
01015       start = end
01016       end += 1
01017       (self.action_feedback.status.status,) = _struct_B.unpack(str[start:end])
01018       start = end
01019       end += 4
01020       (length,) = _struct_I.unpack(str[start:end])
01021       start = end
01022       end += length
01023       if python3:
01024         self.action_feedback.status.text = str[start:end].decode('utf-8')
01025       else:
01026         self.action_feedback.status.text = str[start:end]
01027       return self
01028     except struct.error as e:
01029       raise genpy.DeserializationError(e) #most likely buffer underfill
01030 
01031 _struct_I = genpy.struct_I
01032 _struct_6B = struct.Struct("<6B")
01033 _struct_B = struct.Struct("<B")
01034 _struct_i2h3i = struct.Struct("<i2h3i")
01035 _struct_3I = struct.Struct("<3I")
01036 _struct_6s = struct.Struct("<6s")
01037 _struct_2I = struct.Struct("<2I")


wpa_supplicant_node
Author(s): Package maintained by Blaise Gassend
autogenerated on Thu Apr 24 2014 15:33:19