| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> |
| <title>Doxygen-Generated Content</title> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| <style type="text/css"> |
| <!-- |
| .navigation { |
| display: none; |
| } |
| --> |
| </style> |
| </head> |
| <body> |
| <!-- Generated by Doxygen 1.5.6 --> |
| <div class="navigation" id="top"> |
| <div class="tabs"> |
| <ul> |
| <li><a href="index.html"><span>Main Page</span></a></li> |
| <li><a href="namespaces.html"><span>Namespaces</span></a></li> |
| <li><a href="annotated.html"><span>Data Structures</span></a></li> |
| <li class="current"><a href="files.html"><span>Files</span></a></li> |
| </ul> |
| </div> |
| </div> |
| <div class="contents"> |
| <h1>wifi.h File Reference</h1> |
| <p> |
| <a href="wifi_8h-source.html">Go to the source code of this file.</a><table border="0" cellpadding="0" cellspacing="0"> |
| <tr><td></td></tr> |
| <tr><td colspan="2"><br><h2>Functions</h2></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#ef0be2b5d0603acb8e0ab99051969bb7">wifi_load_driver</a> ()</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Load the Wi-Fi driver. <a href="#ef0be2b5d0603acb8e0ab99051969bb7"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#a0c054da650a0162e40f327eb05679cb">wifi_unload_driver</a> ()</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Unload the Wi-Fi driver. <a href="#a0c054da650a0162e40f327eb05679cb"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#3372e235a7899484912d7f85887e8a47">wifi_start_supplicant</a> ()</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Start supplicant. <a href="#3372e235a7899484912d7f85887e8a47"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#08b97e58f2909489f1f3d59fb31f2c19">wifi_stop_supplicant</a> ()</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Stop supplicant. <a href="#08b97e58f2909489f1f3d59fb31f2c19"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#d81473c3f314ba581e88bb9f1ae37904">wifi_connect_to_supplicant</a> ()</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Open a connection to supplicant. <a href="#d81473c3f314ba581e88bb9f1ae37904"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#a3f8c99b26cfd95e90012cae63ec4826">wifi_close_supplicant_connection</a> ()</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Close connection supplicant. <a href="#a3f8c99b26cfd95e90012cae63ec4826"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#656495e1beea1e39a144cdff776cdb96">wifi_wait_for_event</a> (char *buf, size_t len)</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="wifi_8h.html#656495e1beea1e39a144cdff776cdb96" title="wifi_wait_for_event() performs a blocking call to get a Wi-Fi event and returns a...">wifi_wait_for_event()</a> performs a blocking call to get a Wi-Fi event and returns a string representing a Wi-Fi event when it occurs. <a href="#656495e1beea1e39a144cdff776cdb96"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#b84f92e035b7bc6a5d669b3738c93e32">wifi_command</a> (const char *command, char *reply, size_t *reply_len)</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="wifi_8h.html#b84f92e035b7bc6a5d669b3738c93e32" title="wifi_command() issues a command to the Wi-Fi driver.">wifi_command()</a> issues a command to the Wi-Fi driver. <a href="#b84f92e035b7bc6a5d669b3738c93e32"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#c6876a5403aaeee922d000043a47b25a">do_dhcp_request</a> (int *ipaddr, int *gateway, int *mask, int *dns1, int *dns2, int *server, int *lease)</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="wifi_8h.html#c6876a5403aaeee922d000043a47b25a" title="do_dhcp_request() issues a dhcp request and returns the acquired information.">do_dhcp_request()</a> issues a dhcp request and returns the acquired information. <a href="#c6876a5403aaeee922d000043a47b25a"></a><br></td></tr> |
| <tr><td class="memItemLeft" nowrap align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="wifi_8h.html#8f25ea8ec313efb45affe65fd7c108ee">get_dhcp_error_string</a> ()</td></tr> |
| |
| <tr><td class="mdescLeft"> </td><td class="mdescRight">Return the error string of the last <a class="el" href="wifi_8h.html#c6876a5403aaeee922d000043a47b25a" title="do_dhcp_request() issues a dhcp request and returns the acquired information.">do_dhcp_request()</a>. <a href="#8f25ea8ec313efb45affe65fd7c108ee"></a><br></td></tr> |
| </table> |
| <hr><h2>Function Documentation</h2> |
| <a class="anchor" name="c6876a5403aaeee922d000043a47b25a"></a><!-- doxytag: member="wifi.h::do_dhcp_request" ref="c6876a5403aaeee922d000043a47b25a" args="(int *ipaddr, int *gateway, int *mask, int *dns1, int *dns2, int *server, int *lease)" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int do_dhcp_request </td> |
| <td>(</td> |
| <td class="paramtype">int * </td> |
| <td class="paramname"> <em>ipaddr</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int * </td> |
| <td class="paramname"> <em>gateway</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int * </td> |
| <td class="paramname"> <em>mask</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int * </td> |
| <td class="paramname"> <em>dns1</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int * </td> |
| <td class="paramname"> <em>dns2</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int * </td> |
| <td class="paramname"> <em>server</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">int * </td> |
| <td class="paramname"> <em>lease</em></td><td> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td><td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| <a class="el" href="wifi_8h.html#c6876a5403aaeee922d000043a47b25a" title="do_dhcp_request() issues a dhcp request and returns the acquired information.">do_dhcp_request()</a> issues a dhcp request and returns the acquired information. |
| <p> |
| All IPV4 addresses/mask are in network byte order.<p> |
| <dl compact><dt><b>Parameters:</b></dt><dd> |
| <table border="0" cellspacing="2" cellpadding="0"> |
| <tr><td valign="top"></td><td valign="top"><em>ipaddr</em> </td><td>return the assigned IPV4 address </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>gateway</em> </td><td>return the gateway being used </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>mask</em> </td><td>return the IPV4 mask </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>dns1</em> </td><td>return the IPV4 address of a DNS server </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>dns2</em> </td><td>return the IPV4 address of a DNS server </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>server</em> </td><td>return the IPV4 address of DHCP server </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>lease</em> </td><td>return the length of lease in seconds.</td></tr> |
| </table> |
| </dl> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if successful, < 0 if error. </dd></dl> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="8f25ea8ec313efb45affe65fd7c108ee"></a><!-- doxytag: member="wifi.h::get_dhcp_error_string" ref="8f25ea8ec313efb45affe65fd7c108ee" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">const char* get_dhcp_error_string </td> |
| <td>(</td> |
| <td class="paramname"> </td> |
| <td> ) </td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| Return the error string of the last <a class="el" href="wifi_8h.html#c6876a5403aaeee922d000043a47b25a" title="do_dhcp_request() issues a dhcp request and returns the acquired information.">do_dhcp_request()</a>. |
| <p> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="a3f8c99b26cfd95e90012cae63ec4826"></a><!-- doxytag: member="wifi.h::wifi_close_supplicant_connection" ref="a3f8c99b26cfd95e90012cae63ec4826" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">void wifi_close_supplicant_connection </td> |
| <td>(</td> |
| <td class="paramname"> </td> |
| <td> ) </td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| Close connection supplicant. |
| <p> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, < 0 on failure. </dd></dl> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="b84f92e035b7bc6a5d669b3738c93e32"></a><!-- doxytag: member="wifi.h::wifi_command" ref="b84f92e035b7bc6a5d669b3738c93e32" args="(const char *command, char *reply, size_t *reply_len)" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int wifi_command </td> |
| <td>(</td> |
| <td class="paramtype">const char * </td> |
| <td class="paramname"> <em>command</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">char * </td> |
| <td class="paramname"> <em>reply</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">size_t * </td> |
| <td class="paramname"> <em>reply_len</em></td><td> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td><td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| <a class="el" href="wifi_8h.html#b84f92e035b7bc6a5d669b3738c93e32" title="wifi_command() issues a command to the Wi-Fi driver.">wifi_command()</a> issues a command to the Wi-Fi driver. |
| <p> |
| Android extends the standard commands listed at /link <a href="http://hostap.epitest.fi/wpa_supplicant/devel/ctrl_iface_page.html">http://hostap.epitest.fi/wpa_supplicant/devel/ctrl_iface_page.html</a> to include support for sending commands to the driver:<p> |
| <table border="2" cellspacing="2" cellpadding="2"> |
| <tr> |
| <td><b>Command / Command summary</b> </td><td><b>Form of Response</b> </td><td><b>Processing</b> </td></tr> |
| <tr> |
| <td>DRIVER START<br> |
| Turn on Wi-Fi Hardware </td><td>OK if successful </td><td>OK ? true : false </td></tr> |
| <tr> |
| <td>DRIVER STOP<br> |
| Turn off Wi-Fi hardware </td><td>OK if successful </td><td>OK ? true : false </td></tr> |
| <tr> |
| <td>DRIVER RSSI<br> |
| Return received signal strength indicator in -db for current AP </td><td><ssid> Rssi xx </td><td>*s *s d", &rssi </td></tr> |
| <tr> |
| <td>DRIVER LINKSPEED<br> |
| Return link speed in MBPS </td><td>LinkSpeed xx </td><td>*s d", &linkspd </td></tr> |
| <tr> |
| <td>DRIVER MACADDR<br> |
| Return mac address of the station </td><td>Macaddr = xx.xx.xx.xx.xx.xx </td><td>"%*s = %s", &macadr </td></tr> |
| <tr> |
| <td>DRIVER SCAN-ACTIVE<br> |
| Set scan type to active </td><td>"OK" if successful </td><td>"OK" ? true : false </td></tr> |
| <tr> |
| <td>DRIVER SCAN-PASSIVE<br> |
| Set scan type to passive </td><td>"OK" if successful </td><td>"OK" ? true : false </td></tr> |
| </table> |
| <p> |
| See libs/android_runtime/android_net_wifi_Wifi.cpp for more information describing how these and other commands are invoked.<p> |
| <dl compact><dt><b>Parameters:</b></dt><dd> |
| <table border="0" cellspacing="2" cellpadding="0"> |
| <tr><td valign="top"></td><td valign="top"><em>command</em> </td><td>is the string command </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>reply</em> </td><td>is a buffer to receive a reply string </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>reply_len</em> </td><td>on entry, this is the maximum length of the reply buffer. On exit, the number of bytes in the reply buffer.</td></tr> |
| </table> |
| </dl> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 if successful, < 0 if an error. </dd></dl> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="d81473c3f314ba581e88bb9f1ae37904"></a><!-- doxytag: member="wifi.h::wifi_connect_to_supplicant" ref="d81473c3f314ba581e88bb9f1ae37904" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int wifi_connect_to_supplicant </td> |
| <td>(</td> |
| <td class="paramname"> </td> |
| <td> ) </td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| Open a connection to supplicant. |
| <p> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, < 0 on failure. </dd></dl> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="ef0be2b5d0603acb8e0ab99051969bb7"></a><!-- doxytag: member="wifi.h::wifi_load_driver" ref="ef0be2b5d0603acb8e0ab99051969bb7" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int wifi_load_driver </td> |
| <td>(</td> |
| <td class="paramname"> </td> |
| <td> ) </td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| Load the Wi-Fi driver. |
| <p> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, < 0 on failure. </dd></dl> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="3372e235a7899484912d7f85887e8a47"></a><!-- doxytag: member="wifi.h::wifi_start_supplicant" ref="3372e235a7899484912d7f85887e8a47" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int wifi_start_supplicant </td> |
| <td>(</td> |
| <td class="paramname"> </td> |
| <td> ) </td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| Start supplicant. |
| <p> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, < 0 on failure. </dd></dl> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="08b97e58f2909489f1f3d59fb31f2c19"></a><!-- doxytag: member="wifi.h::wifi_stop_supplicant" ref="08b97e58f2909489f1f3d59fb31f2c19" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int wifi_stop_supplicant </td> |
| <td>(</td> |
| <td class="paramname"> </td> |
| <td> ) </td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| Stop supplicant. |
| <p> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, < 0 on failure. </dd></dl> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="a0c054da650a0162e40f327eb05679cb"></a><!-- doxytag: member="wifi.h::wifi_unload_driver" ref="a0c054da650a0162e40f327eb05679cb" args="()" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int wifi_unload_driver </td> |
| <td>(</td> |
| <td class="paramname"> </td> |
| <td> ) </td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| Unload the Wi-Fi driver. |
| <p> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>0 on success, < 0 on failure. </dd></dl> |
| |
| </div> |
| </div><p> |
| <a class="anchor" name="656495e1beea1e39a144cdff776cdb96"></a><!-- doxytag: member="wifi.h::wifi_wait_for_event" ref="656495e1beea1e39a144cdff776cdb96" args="(char *buf, size_t len)" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">int wifi_wait_for_event </td> |
| <td>(</td> |
| <td class="paramtype">char * </td> |
| <td class="paramname"> <em>buf</em>, </td> |
| </tr> |
| <tr> |
| <td class="paramkey"></td> |
| <td></td> |
| <td class="paramtype">size_t </td> |
| <td class="paramname"> <em>len</em></td><td> </td> |
| </tr> |
| <tr> |
| <td></td> |
| <td>)</td> |
| <td></td><td></td><td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| |
| <p> |
| <a class="el" href="wifi_8h.html#656495e1beea1e39a144cdff776cdb96" title="wifi_wait_for_event() performs a blocking call to get a Wi-Fi event and returns a...">wifi_wait_for_event()</a> performs a blocking call to get a Wi-Fi event and returns a string representing a Wi-Fi event when it occurs. |
| <p> |
| <dl compact><dt><b>Parameters:</b></dt><dd> |
| <table border="0" cellspacing="2" cellpadding="0"> |
| <tr><td valign="top"></td><td valign="top"><em>buf</em> </td><td>is the buffer that receives the event </td></tr> |
| <tr><td valign="top"></td><td valign="top"><em>len</em> </td><td>is the maximum length of the buffer</td></tr> |
| </table> |
| </dl> |
| <dl class="return" compact><dt><b>Returns:</b></dt><dd>number of bytes in buffer, 0 if no event (for instance, no connection), and less than 0 if there is an error. </dd></dl> |
| |
| </div> |
| </div><p> |
| </div> |
| </body> |
| </html> |