Host library for controlling a WiConnect enabled Wi-Fi module.

Dependents:   wiconnect-ota_example wiconnect-web_setup_example wiconnect-test-console wiconnect-tcp_server_example ... more

doc/html/group__api__socket__misc.html

Committer:
dan_ackme
Date:
2014-10-23
Revision:
26:8067e3d463d3
Parent:
17:7268f365676b
Child:
29:b6af04b77a56

File content as of revision 26:8067e3d463d3:

<!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/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>ACKme WiConnect Host Library</title>
<link rel="icon" href="favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea" style="font-family:verdana;">
    <table border='0' cellpadding='0' cellspacing='0' width="98%">
      <tr style="height:20px"><td>&nbsp;</td></tr>
      <tr style="border-collapse: collapse; padding: 0;">
        <td style="width:20px"></td>
        <td style="padding-right:40px"><img src="ackmelogo.png" alt="ACKme Logo" /></td>
        <td style="vertical-align:middle; text-align:left; font: bold 25px/100% Verdana, Arial, Helvetica, sans-serif;">
        WiConnect Host Library- API Reference Guide</td>
        <td style="width:20px"></td>
      </tr>
      <tr><td>&nbsp;</td></tr>
    </table>
</div><!-- Generated by Doxygen 1.8.7 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Library&#160;Overview</span></a></li>
      <li><a href="modules.html"><span>Library&#160;API</span></a></li>
      <li><a href="examples.html"><span>API&#160;Examples</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="http://wiconnect.ack.me/2.0/general_overview"><span>WiConnect&#160;Reference&#160;Manual</span></a></li>
      <li><a href="http://www.ack.me/WiConnect"><span>ACKme&#160;Website</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__api__socket__misc.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Miscellaneous Methods<div class="ingroups"><a class="el" href="group__api__socket.html">Socket</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Miscellaneous socket methods.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga8a80d96efac7cc514fe7fc61d1878106"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__socket__misc.html#ga8a80d96efac7cc514fe7fc61d1878106">wiconnect::SocketInterface::closeAllSockets</a> ()</td></tr>
<tr class="memdesc:ga8a80d96efac7cc514fe7fc61d1878106"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close all opened sockets.  <a href="#ga8a80d96efac7cc514fe7fc61d1878106">More...</a><br /></td></tr>
<tr class="separator:ga8a80d96efac7cc514fe7fc61d1878106"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga94d1eb5407cb8b60ad366ecbe0e1b52a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__socket__misc.html#ga94d1eb5407cb8b60ad366ecbe0e1b52a">wiconnect::SocketInterface::registerSocketIrqHandler</a> (<a class="el" href="group__api__core__types.html#ga1cf4dfa71da0b0dc3dc707dacf56cc9c">Pin</a> irqPin, const <a class="el" href="classwiconnect_1_1_callback.html">Callback</a> &amp;handler)</td></tr>
<tr class="memdesc:ga94d1eb5407cb8b60ad366ecbe0e1b52a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a host pin as an external interrupt. When the external interrupt is triggered, the supplied callback is executed.  <a href="#ga94d1eb5407cb8b60ad366ecbe0e1b52a">More...</a><br /></td></tr>
<tr class="separator:ga94d1eb5407cb8b60ad366ecbe0e1b52a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga820d2fdb12d343212638e55633bd8551"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__socket__misc.html#ga820d2fdb12d343212638e55633bd8551">wiconnect::SocketInterface::unregisterSocketIrqHandler</a> (<a class="el" href="group__api__core__types.html#ga1cf4dfa71da0b0dc3dc707dacf56cc9c">Pin</a> irqPin)</td></tr>
<tr class="memdesc:ga820d2fdb12d343212638e55633bd8551"><td class="mdescLeft">&#160;</td><td class="mdescRight">Unregister a previously registered IRQ pin.  <a href="#ga820d2fdb12d343212638e55633bd8551">More...</a><br /></td></tr>
<tr class="separator:ga820d2fdb12d343212638e55633bd8551"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga037cb2813683697342fff01239c7f6f8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__api__socket__misc.html#ga037cb2813683697342fff01239c7f6f8">wiconnect::SocketInterface::connect</a> (<a class="el" href="classwiconnect_1_1_wiconnect_socket.html">WiconnectSocket</a> &amp;socket, <a class="el" href="group__api__socket__types.html#ga69dc55558df4c81599c5fb3dff98756d">SocketType</a> type, const char *host, uint16_t remortPort, uint16_t localPort, const void *args, <a class="el" href="group__api__core__types.html#ga1cf4dfa71da0b0dc3dc707dacf56cc9c">Pin</a> irqPin)</td></tr>
<tr class="memdesc:ga037cb2813683697342fff01239c7f6f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connect to remote server.  <a href="#ga037cb2813683697342fff01239c7f6f8">More...</a><br /></td></tr>
<tr class="separator:ga037cb2813683697342fff01239c7f6f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Miscellaneous socket methods. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga8a80d96efac7cc514fe7fc61d1878106"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a> wiconnect::SocketInterface::closeAllSockets </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Close all opened sockets. </p>
<dl class="section note"><dt>Note</dt><dd>This closes all open sockets on the MODULE side. Socket objects on the HOST side will be still open until issuing a read/write command to the module using the socket handle.</dd></dl>
<dl class="section return"><dt>Returns</dt><dd>Result of method. See <a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga037cb2813683697342fff01239c7f6f8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a> wiconnect::SocketInterface::connect </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classwiconnect_1_1_wiconnect_socket.html">WiconnectSocket</a> &amp;&#160;</td>
          <td class="paramname"><em>socket</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__api__socket__types.html#ga69dc55558df4c81599c5fb3dff98756d">SocketType</a>&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>host</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>remortPort</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>localPort</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>args</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__api__core__types.html#ga1cf4dfa71da0b0dc3dc707dacf56cc9c">Pin</a>&#160;</td>
          <td class="paramname"><em>irqPin</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connect to remote server. </p>
<p>This is the base method used by all the other connect methods.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">socket</td><td><a class="el" href="classwiconnect_1_1_wiconnect_socket.html">WiconnectSocket</a> object of opened connection. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>The <a class="el" href="group__api__socket__types.html#ga69dc55558df4c81599c5fb3dff98756d">SocketType</a> of connection to open </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">host</td><td>The host/IP address of the remote server </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">remortPort</td><td>The port of the remote server </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">localPort</td><td>The port of the module's side of the connection </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">args</td><td>Depedent on the connection type </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">irqPin</td><td>Data available external interrupt pin. See <a class="el" href="group__api__socket__misc.html#ga94d1eb5407cb8b60ad366ecbe0e1b52a" title="Register a host pin as an external interrupt. When the external interrupt is triggered, the supplied callback is executed. ">registerSocketIrqHandler()</a> for more info </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of method. See <a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a> </dd></dl>

</div>
</div>
<a class="anchor" id="ga94d1eb5407cb8b60ad366ecbe0e1b52a"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a> wiconnect::SocketInterface::registerSocketIrqHandler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__api__core__types.html#ga1cf4dfa71da0b0dc3dc707dacf56cc9c">Pin</a>&#160;</td>
          <td class="paramname"><em>irqPin</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classwiconnect_1_1_callback.html">Callback</a> &amp;&#160;</td>
          <td class="paramname"><em>handler</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a host pin as an external interrupt. When the external interrupt is triggered, the supplied callback is executed. </p>
<p>This should be called before calling one of the connect methods below with an irqPin parameter.</p>
<p>Basically how this works is:</p><ol type="1">
<li>The supplied irqPin is configured as an external interrupt pin.</li>
<li>A connection is opened and configured with the same irqPin. This irqPin physically connected to a GPIO on the WiFi module.</li>
<li>When the WiFi module has data to send to the HOST it asserts the irqPin.</li>
<li>The irqPin interrupt executes and calls the supplied handler.</li>
<li><p class="startli">The handler should notify the HOST that the given irqPin has triggered and have the associated socket read data from the module.</p>
<dl class="section note"><dt>Note</dt><dd>arg1 of the handler contains the irqPin</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">irqPin</td><td>The HOST pin to configure as an external interrupt. This pin should be physically connected to a module GPIO. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">handler</td><td><a class="el" href="classwiconnect_1_1_callback.html" title="Generic callback function. ">Callback</a> to be executed with the external irqPin interrupt triggers </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of method. See <a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a> </dd></dl>
</li>
</ol>

</div>
</div>
<a class="anchor" id="ga820d2fdb12d343212638e55633bd8551"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a> wiconnect::SocketInterface::unregisterSocketIrqHandler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__api__core__types.html#ga1cf4dfa71da0b0dc3dc707dacf56cc9c">Pin</a>&#160;</td>
          <td class="paramname"><em>irqPin</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Unregister a previously registered IRQ pin. </p>
<p>This disables the given irqPin as an external interrupt. Refer to <a class="el" href="group__api__socket__misc.html#ga94d1eb5407cb8b60ad366ecbe0e1b52a" title="Register a host pin as an external interrupt. When the external interrupt is triggered, the supplied callback is executed. ">registerSocketIrqHandler()</a> for more information.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">irqPin</td><td>The HOST pin to unregister </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Result of method. See <a class="el" href="group__api__core__types.html#ga325637ed501728bd6c8c7a7982b9ce05">WiconnectResult</a> </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">&copy; ACKme Networks 2014</li>
  </ul>
</div>
</body>
</html>