<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html40/loose.dtd"> <html> <head> <title>HappyDoc Generated Documentation</title> </head> <body bgcolor="#ffffff"> <table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th rowspan="2" valign="top" align="left" width="10%" bgcolor="#88bbee"><font color="#000000">HappyDoc Generated Documentation</font> </th> <th bgcolor="#88bbee" width="90%" align="right"><font color="#000000">Class: ConnectionManager</font> </th> </tr> <tr> <td> <!-- breadcrumbs --> <p><small> / <a href="../wifi-radar.html">wifi-radar.py</a> / ConnectionManager </small></p> <!-- /breadcrumbs --> <p>Manage a connection; including reporting connection state, connecting/disconnecting from an AP, and returning current IP, ESSID, and BSSID.</p> <table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="">Methods</a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000"> </font> </th> </tr> <tr> <td> <table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="if_change"></a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000">if_change </font> </th> </tr> <tr> <td> <pre> if_change ( self, state ) </pre> <p>Change the interface state: up or down.</p> <h4>Parameters:</h4> <dl> <dt> <code>state</code></dt> <dd>string - The state to which to change the interface.</dd> </dl> <h4>Returns:</h4> <p> nothing</p> </td></tr> </table><table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="get_current_bssid"></a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000">get_current_bssid </font> </th> </tr> <tr> <td> <pre> get_current_bssid ( self ) </pre> <p>Returns the current BSSID, if any, by calling iwconfig.</p> <h4>Parameters:</h4> <p> nothing</p> <h4>Returns:</h4> <dl> <dt> string or None</dt> <dd>the BSSID or None (if no there is no current association)</dd> </dl> </td></tr> </table><table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="connect_to_network"></a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000">connect_to_network </font> </th> </tr> <tr> <td> <pre> connect_to_network ( self, profile, status, ) </pre> <p>Connect to the specified AP.</p> <h4>Parameters:</h4> <dl> <dt> <code>profile</code></dt> <dd>dictionary - The profile for the AP (i.e. network) with which to connect.</dd> <dt> <code>status</code></dt> <dd>status implementer - Object which implements status interface.</dd> </dl> <h4>Returns:</h4> <p> nothing</p> <table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="">Exceptions</a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000"> </font> </th> </tr> <tr> <td> <p> TypeError( "Empty AP address" )<br> </p> </td></tr> </table></td></tr> </table><table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="__init__"></a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000">__init__ </font> </th> </tr> <tr> <td> <pre> __init__ ( self, confFile, commandQueue, logger, ) </pre> <p>Create a new connection manager which can read a config file and send to scanning thread command Queue. A new manager checks for a pre-existing connection and takes its AP profile from the ESSID and BSSID to which it is currently attached.</p> <h4>Parameters:</h4> <dl> <dt> <code>confFile</code></dt> <dd>ConfigFile - Config file object</dd> <dt> <code>commandQueue</code></dt> <dd>Queue - The Queue on which to put commands to the scanning thread</dd> <dt> <code>logger</code></dt> <dd>Logger - Python's logging facility</dd> </dl> <h4>Returns:</h4> <p> ConnectionManager instance</p> </td></tr> </table><table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="get_current_essid"></a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000">get_current_essid </font> </th> </tr> <tr> <td> <pre> get_current_essid ( self ) </pre> <p>Returns the current ESSID, if any, by calling iwconfig.</p> <h4>Parameters:</h4> <p> nothing</p> <h4>Returns:</h4> <dl> <dt> string or None</dt> <dd>the ESSID or None (if no there is no current association)</dd> </dl> </td></tr> </table><table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="get_current_ip"></a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000">get_current_ip </font> </th> </tr> <tr> <td> <pre> get_current_ip ( self ) </pre> <p>Returns the current IP, if any, by calling ifconfig.</p> <h4>Parameters:</h4> <p> nothing</p> <h4>Returns:</h4> <dl> <dt> string or None</dt> <dd>the IP address or None (if no there is no current connection)</dd> </dl> </td></tr> </table><table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="disconnect_interface"></a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000">disconnect_interface </font> </th> </tr> <tr> <td> <pre> disconnect_interface ( self ) </pre> <p>Disconnect from the AP with which a connection has been established/attempted.</p> <h4>Parameters:</h4> <p> nothing</p> <h4>Returns:</h4> <p> nothing</p> <table border="0" cellpadding="5" cellspacing="0" width="100%"> <tr> <th bgcolor="#99ccff" rowspan="2" valign="top" align="left" width="20%" > <font color="#000000"> <a name="">Exceptions</a> </font> </th> <th bgcolor="#99ccff" valign="top" align="left" width="80%" > <font color="#000000"> </font> </th> </tr> <tr> <td> <p> KeyError<br> </p> </td></tr> </table></td></tr> </table></td></tr> </table> </td> </tr> </table> <hr> <font size="-2"><i>This document was automatically generated Thu May 21 05:32:36 2009 by <a href="http://happydoc.sourceforge.net">HappyDoc</a> version 3.1</i></font> </body> </html>