Update developer docs
[wifi-radar.git] / docs / developer / wifi-radar.py / ConnectionManager.html
blobb210338b93fdea99d42ebc8fc1266fc8a9fb7ade
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html40/loose.dtd">
4 <html>
6 <head>
7 <title>HappyDoc Generated Documentation</title>
8 </head>
10 <body bgcolor="#ffffff">
13 <table border="0" cellpadding="5" cellspacing="0" width="100%">
14 <tr>
15 <th rowspan="2"
16 valign="top"
17 align="left"
18 width="10%"
19 bgcolor="#88bbee"><font color="#000000">HappyDoc Generated Documentation</font>
20 </th>
21 <th bgcolor="#88bbee"
22 width="90%"
23 align="right"><font color="#000000">Class: ConnectionManager</font>
24 </th>
25 </tr>
26 <tr>
27 <td>
28 <!-- breadcrumbs -->
29 <p><small>
30 /&nbsp;<a href="../wifi-radar.html">wifi-radar.py</a>&nbsp;/&nbsp;ConnectionManager&nbsp;</small></p>
32 <!-- /breadcrumbs -->
34 <p>Manage a connection; including reporting connection state,
35 connecting/disconnecting from an AP, and returning current IP, ESSID, and BSSID.</p>
36 <table border="0" cellpadding="5" cellspacing="0" width="100%">
38 <tr>
39 <th bgcolor="#99ccff"
40 rowspan="2"
41 valign="top"
42 align="left"
43 width="20%"
45 <font color="#000000">
46 <a name="">Methods</a>&nbsp;
47 </font>
48 </th>
49 <th bgcolor="#99ccff"
50 valign="top"
51 align="left"
52 width="80%"
54 <font color="#000000">&nbsp;</font>
55 </th>
56 </tr>
57 <tr>
58 <td>
59 <table border="0" cellpadding="5" cellspacing="0" width="100%">
61 <tr>
62 <th bgcolor="#99ccff"
63 rowspan="2"
64 valign="top"
65 align="left"
66 width="20%"
68 <font color="#000000">
69 <a name="if_change"></a>&nbsp;
70 </font>
71 </th>
72 <th bgcolor="#99ccff"
73 valign="top"
74 align="left"
75 width="80%"
77 <font color="#000000">if_change&nbsp;</font>
78 </th>
79 </tr>
80 <tr>
81 <td>
82 <pre>
83 if_change ( self, state )
84 </pre>
86 <p>Change the interface state: up or down.</p>
87 <h4>Parameters:</h4>
88 <dl>
89 <dt> <code>state</code></dt>
90 <dd>string - The state to which to change the interface.</dd>
91 </dl>
92 <h4>Returns:</h4>
93 <p> nothing</p>
94 </td></tr>
95 </table><table border="0" cellpadding="5" cellspacing="0" width="100%">
97 <tr>
98 <th bgcolor="#99ccff"
99 rowspan="2"
100 valign="top"
101 align="left"
102 width="20%"
104 <font color="#000000">
105 <a name="get_current_bssid"></a>&nbsp;
106 </font>
107 </th>
108 <th bgcolor="#99ccff"
109 valign="top"
110 align="left"
111 width="80%"
113 <font color="#000000">get_current_bssid&nbsp;</font>
114 </th>
115 </tr>
116 <tr>
117 <td>
118 <pre>
119 get_current_bssid ( self )
120 </pre>
122 <p>Returns the current BSSID, if any, by calling iwconfig.</p>
123 <h4>Parameters:</h4>
124 <p> nothing</p>
125 <h4>Returns:</h4>
126 <dl>
127 <dt> string or None</dt>
128 <dd>the BSSID or None (if no there is no current association)</dd>
129 </dl>
130 </td></tr>
131 </table><table border="0" cellpadding="5" cellspacing="0" width="100%">
133 <tr>
134 <th bgcolor="#99ccff"
135 rowspan="2"
136 valign="top"
137 align="left"
138 width="20%"
140 <font color="#000000">
141 <a name="connect_to_network"></a>&nbsp;
142 </font>
143 </th>
144 <th bgcolor="#99ccff"
145 valign="top"
146 align="left"
147 width="80%"
149 <font color="#000000">connect_to_network&nbsp;</font>
150 </th>
151 </tr>
152 <tr>
153 <td>
154 <pre>
155 connect_to_network (
156 self,
157 profile,
158 status,
160 </pre>
162 <p>Connect to the specified AP.</p>
163 <h4>Parameters:</h4>
164 <dl>
165 <dt> <code>profile</code></dt>
166 <dd>dictionary - The profile for the AP (i.e. network) with which to connect.</dd>
167 <dt> <code>status</code></dt>
168 <dd>status implementer - Object which implements status interface.</dd>
169 </dl>
170 <h4>Returns:</h4>
171 <p> nothing</p>
172 <table border="0" cellpadding="5" cellspacing="0" width="100%">
174 <tr>
175 <th bgcolor="#99ccff"
176 rowspan="2"
177 valign="top"
178 align="left"
179 width="20%"
181 <font color="#000000">
182 <a name="">Exceptions</a>&nbsp;
183 </font>
184 </th>
185 <th bgcolor="#99ccff"
186 valign="top"
187 align="left"
188 width="80%"
190 <font color="#000000">&nbsp;</font>
191 </th>
192 </tr>
193 <tr>
194 <td>
196 TypeError( "Empty AP address" )<br>
197 </p>
198 </td></tr>
199 </table></td></tr>
200 </table><table border="0" cellpadding="5" cellspacing="0" width="100%">
202 <tr>
203 <th bgcolor="#99ccff"
204 rowspan="2"
205 valign="top"
206 align="left"
207 width="20%"
209 <font color="#000000">
210 <a name="__init__"></a>&nbsp;
211 </font>
212 </th>
213 <th bgcolor="#99ccff"
214 valign="top"
215 align="left"
216 width="80%"
218 <font color="#000000">__init__&nbsp;</font>
219 </th>
220 </tr>
221 <tr>
222 <td>
223 <pre>
224 __init__ (
225 self,
226 confFile,
227 commandQueue,
228 logger,
230 </pre>
232 <p>Create a new connection manager which can read a config file and send to scanning thread
233 command Queue. A new manager checks for a pre-existing connection and takes
234 its AP profile from the ESSID and BSSID to which it is currently attached.</p>
235 <h4>Parameters:</h4>
236 <dl>
237 <dt> <code>confFile</code></dt>
238 <dd>ConfigFile - Config file object</dd>
239 <dt> <code>commandQueue</code></dt>
240 <dd>Queue - The Queue on which to put commands to the scanning thread</dd>
241 <dt> <code>logger</code></dt>
242 <dd>Logger - Python's logging facility</dd>
243 </dl>
244 <h4>Returns:</h4>
245 <p> ConnectionManager instance</p>
246 </td></tr>
247 </table><table border="0" cellpadding="5" cellspacing="0" width="100%">
249 <tr>
250 <th bgcolor="#99ccff"
251 rowspan="2"
252 valign="top"
253 align="left"
254 width="20%"
256 <font color="#000000">
257 <a name="get_current_essid"></a>&nbsp;
258 </font>
259 </th>
260 <th bgcolor="#99ccff"
261 valign="top"
262 align="left"
263 width="80%"
265 <font color="#000000">get_current_essid&nbsp;</font>
266 </th>
267 </tr>
268 <tr>
269 <td>
270 <pre>
271 get_current_essid ( self )
272 </pre>
274 <p>Returns the current ESSID, if any, by calling iwconfig.</p>
275 <h4>Parameters:</h4>
276 <p> nothing</p>
277 <h4>Returns:</h4>
278 <dl>
279 <dt> string or None</dt>
280 <dd>the ESSID or None (if no there is no current association)</dd>
281 </dl>
282 </td></tr>
283 </table><table border="0" cellpadding="5" cellspacing="0" width="100%">
285 <tr>
286 <th bgcolor="#99ccff"
287 rowspan="2"
288 valign="top"
289 align="left"
290 width="20%"
292 <font color="#000000">
293 <a name="get_current_ip"></a>&nbsp;
294 </font>
295 </th>
296 <th bgcolor="#99ccff"
297 valign="top"
298 align="left"
299 width="80%"
301 <font color="#000000">get_current_ip&nbsp;</font>
302 </th>
303 </tr>
304 <tr>
305 <td>
306 <pre>
307 get_current_ip ( self )
308 </pre>
310 <p>Returns the current IP, if any, by calling ifconfig.</p>
311 <h4>Parameters:</h4>
312 <p> nothing</p>
313 <h4>Returns:</h4>
314 <dl>
315 <dt> string or None</dt>
316 <dd>the IP address or None (if no there is no current connection)</dd>
317 </dl>
318 </td></tr>
319 </table><table border="0" cellpadding="5" cellspacing="0" width="100%">
321 <tr>
322 <th bgcolor="#99ccff"
323 rowspan="2"
324 valign="top"
325 align="left"
326 width="20%"
328 <font color="#000000">
329 <a name="disconnect_interface"></a>&nbsp;
330 </font>
331 </th>
332 <th bgcolor="#99ccff"
333 valign="top"
334 align="left"
335 width="80%"
337 <font color="#000000">disconnect_interface&nbsp;</font>
338 </th>
339 </tr>
340 <tr>
341 <td>
342 <pre>
343 disconnect_interface ( self )
344 </pre>
346 <p>Disconnect from the AP with which a connection has been established/attempted.</p>
347 <h4>Parameters:</h4>
348 <p> nothing</p>
349 <h4>Returns:</h4>
350 <p> nothing</p>
351 <table border="0" cellpadding="5" cellspacing="0" width="100%">
353 <tr>
354 <th bgcolor="#99ccff"
355 rowspan="2"
356 valign="top"
357 align="left"
358 width="20%"
360 <font color="#000000">
361 <a name="">Exceptions</a>&nbsp;
362 </font>
363 </th>
364 <th bgcolor="#99ccff"
365 valign="top"
366 align="left"
367 width="80%"
369 <font color="#000000">&nbsp;</font>
370 </th>
371 </tr>
372 <tr>
373 <td>
375 KeyError<br>
376 </p>
377 </td></tr>
378 </table></td></tr>
379 </table></td></tr>
380 </table>
381 </td>
382 </tr>
383 </table>
385 <hr>
387 <font size="-2"><i>This document was automatically generated
388 Sun Apr 19 14:31:33 2009 by <a
389 href="http://happydoc.sourceforge.net">HappyDoc</a> version
390 3.1</i></font>
392 </body>
393 </html>