mirror of
https://github.com/buildwithparallel/mm-iot-sdk
synced 2026-08-10 21:27:58 -04:00
This commit introduces version 2.9.7 of the Morse Micro MM-IoT-SDK for ARM microcontroller base platforms.
831 lines
50 KiB
HTML
831 lines
50 KiB
HTML
<!-- HTML header for doxygen 1.8.17-->
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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"/>
|
|
<meta name="generator" content="Doxygen 1.9.4"/>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
|
<title>Morse Micro IoT SDK: m2m_controller.c File Reference</title>
|
|
<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="navtreedata.js"></script>
|
|
<script type="text/javascript" src="navtree.js"></script>
|
|
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
|
<script type="text/javascript" src="search/searchdata.js"></script>
|
|
<script type="text/javascript" src="search/search.js"></script>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
|
<link href="style.css" rel="stylesheet" type="text/css"/>
|
|
<link rel="shortcut icon" href="favicon.svg" />
|
|
</head>
|
|
<body>
|
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
<div id="titlearea">
|
|
<table cellspacing="0" cellpadding="0">
|
|
<tbody>
|
|
<tr style="height: 56px;">
|
|
<td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
|
|
<td id="projectalign" style="padding-left: 0.5em;">
|
|
<div id="projectname">Morse Micro IoT SDK
|
|
 <span id="projectnumber">2.9.7</span>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
<!-- end header part -->
|
|
<!-- Generated by Doxygen 1.9.4 -->
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
|
|
/* @license-end */
|
|
</script>
|
|
<script type="text/javascript" src="menudata.js"></script>
|
|
<script type="text/javascript" src="menu.js"></script>
|
|
<script type="text/javascript">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(function() {
|
|
initMenu('',true,false,'search.php','Search');
|
|
$(document).ready(function() { init_search(); });
|
|
});
|
|
/* @license-end */
|
|
</script>
|
|
<div id="main-nav"></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">
|
|
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
|
$(document).ready(function(){initNavTree('m2m__controller_8c.html',''); initResizable(); });
|
|
/* @license-end */
|
|
</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)">
|
|
</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="#nested-classes">Data Structures</a> |
|
|
<a href="#define-members">Macros</a> |
|
|
<a href="#func-members">Functions</a> |
|
|
<a href="#var-members">Variables</a> </div>
|
|
<div class="headertitle"><div class="title">m2m_controller.c File Reference</div></div>
|
|
</div><!--header-->
|
|
<div class="contents">
|
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
|
<div class="textblock"><p >M2M Controller example application. </p>
|
|
<dl class="section note"><dt>Note</dt><dd>It is assumed that you have followed the steps in the <a class="el" href="GETTING_STARTED.html">Getting Started</a> guide and are therefore familiar with how to build, flash, and monitor an application using the MM-IoT-SDK framework.</dd></dl>
|
|
<p>The <a class="el" href="m2m__agent_8c.html">m2m_agent.c</a> and <a class="el" href="m2m__controller_8c.html">m2m_controller.c</a> example applications demonstrate how to use the MMAGIC M2M interface.</p>
|
|
<h1><a class="anchor" id="M2M_GETTING_STARTED"></a>
|
|
Getting Started</h1>
|
|
<h2><a class="anchor" id="autotoc_md33"></a>
|
|
Setup</h2>
|
|
<p >To setup this demonstration you will need the following:</p><ul>
|
|
<li>One <code>mm-ekh08-u575</code> reference platform (See <a class="el" href="MMPLATFORMS.html">Morse Micro IoT Reference Platforms</a>) - this includes a ST <code>NUCLEO-U575ZI-Q</code> board as the motherboard.</li>
|
|
<li>An additional ST <code>NUCLEO-U575ZI-Q</code> development board</li>
|
|
<li>A Morse Micro Access Point connected to the Internet via Ethernet</li>
|
|
</ul>
|
|
<p >For the purposes of this demonstration the <code>mm-ekh08-u575</code> will be the agent and the standalone <code>NUCLEO-U575ZI-Q</code> board will be the controller. The two boards will communicate over the SPI bus, so connect the <code>SPI</code> buses on the two ST <code>NUCLEO-U575ZI-Q</code> boards together in a 1:1 configuration. Connect them up as shown in the table below:</p>
|
|
<table class="markdownTable">
|
|
<tr class="markdownTableHead">
|
|
<th class="markdownTableHeadNone">Pin </th><th class="markdownTableHeadNone">On Agent - <code>mm-ekh08-u575</code> </th><th class="markdownTableHeadNone">On Controller - <code>NUCLEO-U575ZI-Q</code> </th></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>M2M_SPI_MOSI</code> </td><td class="markdownTableBodyNone"><code>PD4</code> on connector <code>CN9</code> </td><td class="markdownTableBodyNone"><code>PD4</code> on connector <code>CN9</code> </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>M2M_SPI_MISO</code> </td><td class="markdownTableBodyNone"><code>PD3</code> on connector <code>CN9</code> </td><td class="markdownTableBodyNone"><code>PD3</code> on connector <code>CN9</code> </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>M2M_SPI_SCK</code> </td><td class="markdownTableBodyNone"><code>PB13</code> on connector <code>CN7</code> </td><td class="markdownTableBodyNone"><code>PB13</code> on connector <code>CN7</code> </td></tr>
|
|
<tr class="markdownTableRowEven">
|
|
<td class="markdownTableBodyNone"><code>M2M_SPI_NSS</code> </td><td class="markdownTableBodyNone"><code>PB9</code> on connector <code>CN7</code> </td><td class="markdownTableBodyNone"><code>PB9</code> on connector <code>CN7</code> </td></tr>
|
|
<tr class="markdownTableRowOdd">
|
|
<td class="markdownTableBodyNone"><code>GND</code> </td><td class="markdownTableBodyNone">Any convenient <code>GND</code> pin </td><td class="markdownTableBodyNone">Any convenient <code>GND</code> pin </td></tr>
|
|
</table>
|
|
<p >For an example of M2M communications over UART, see the <a class="el" href="cli_8c.html">cli.c</a> application which has an M2M mode.</p>
|
|
<h2><a class="anchor" id="autotoc_md34"></a>
|
|
Building</h2>
|
|
<p >The <code>Wi-Fi</code> SSID and password are hard coded in <a class="el" href="m2m__controller_8c.html">m2m_controller.c</a> as this application is very basic and does not support saving settings using persistent store. The controller application is kept simple to allow easy porting of the controller to any platform. Update <code>SSID</code> and <code>SAE_PASSPHRASE</code> as appropriate for your test setup and build the <code>m2m_agent</code> and the <code>m2m_controller</code> applications as shown in <a class="el" href="GETTING_STARTED.html#BUILDING_FIRMWARE">Building Firmware</a>.</p>
|
|
<h2><a class="anchor" id="autotoc_md35"></a>
|
|
Running</h2>
|
|
<ul>
|
|
<li>Load the built <code>m2m_agent.elf</code> firmware into the <code>mm-ekh08-u575</code> device as explained in <a class="el" href="GETTING_STARTED.html#PROGRAMMING_FIRMWARE">Programming</a>. Ensure you have loaded the Board Configuration File (BCF) and set the 2 letter country code in the <code>wlan.country_code</code> setting in persistent storage as described in <a class="el" href="GETTING_STARTED.html#SET_APP_CONFIGURATION">Setting Application Configuration</a>.</li>
|
|
<li>Execute the <code>m2m_agent</code> application by resetting the device or issuing the <code>continue</code> command in <code>gdb</code>. You should see the following message on the console: <div class="fragment"><div class="line">M2M Agent Example (Built May 8 2024 17:06:40)</div>
|
|
<div class="line"> </div>
|
|
<div class="line">M2M <span class="keyword">interface </span>enabled</div>
|
|
</div><!-- fragment --></li>
|
|
<li>Load the built <code>m2m_controller.elf</code> firmware into the bare ST <code>NUCLEO-U575ZI-Q</code> as explained in <a class="el" href="GETTING_STARTED.html#PROGRAMMING_FIRMWARE">Programming</a>. Note that the controller does not have any persistent storage and so you do not need to load any BCF files or settings into persistent storage as you would do with proper <a class="el" href="MMPLATFORMS.html">Morse Micro IoT Reference Platforms</a>.</li>
|
|
<li>Execute the <code>m2m_controller</code> application by resetting the device or issuing the <code>continue</code> command in <code>gdb</code>. You should see the following message on the console: <div class="fragment"><div class="line">M2M Controller Example (Built May 9 2024 09:12:18)</div>
|
|
<div class="line"> </div>
|
|
<div class="line">M2M Controller enabled. Awaiting Agent start</div>
|
|
<div class="line">MMAGIC_LLC: Received agent START <span class="keyword">event</span>!</div>
|
|
<div class="line">Agent start notification received</div>
|
|
<div class="line"> </div>
|
|
<div class="line"> </div>
|
|
<div class="line"><span class="preprocessor">#### Example WLAN Connect using MMAGIC Controller ####</span></div>
|
|
<div class="line"> </div>
|
|
<div class="line">Attempting to connect to MHS_Test with passphrase 12345678</div>
|
|
<div class="line">This may take some time (~10 seconds)</div>
|
|
<div class="line">Link Up</div>
|
|
<div class="line">Link is up (DHCP). Time: 10483 ms, IP: 192.168.1.189, Netmask: 255.255.255.0, Gateway:</div>
|
|
<div class="line">192.168.1.1</div>
|
|
<div class="line">WLAN connection established</div>
|
|
<div class="line">...</div>
|
|
<div class="line"><output continues></div>
|
|
<div class="line">...</div>
|
|
</div><!-- fragment --></li>
|
|
</ul>
|
|
<dl class="section note"><dt>Note</dt><dd><ul>
|
|
<li>If the controller gets stuck at the following message, check the connections and try restarting the <code>m2m_agent</code> application. <div class="fragment"><div class="line">M2M Controller enabled. Awaiting Agent start</div>
|
|
</div><!-- fragment --></li>
|
|
<li>If the controller gets an error after the following message, check the access point can connect to the internet and is setup for bridging or routing. <div class="fragment"><div class="line"><span class="preprocessor">#### Example TCP Client using MMAGIC Controller ####</span></div>
|
|
</div><!-- fragment --></li>
|
|
</ul>
|
|
</dd></dl>
|
|
<h2><a class="anchor" id="autotoc_md36"></a>
|
|
Testing the TCP Echo Server</h2>
|
|
<p >In addition to an example TCP client that connects to a web server and the beacon monitor example, the <code>m2m_controller</code> also demonstrates how to use TCP server sockets to serve multiple incoming TCP client connections.</p>
|
|
<h3><a class="anchor" id="autotoc_md37"></a>
|
|
Using Telnet</h3>
|
|
<ul>
|
|
<li>Note the IP address assigned to the system (Agent + Controller is the system) in the Link Up message displayed by the controller.</li>
|
|
<li>When you see the following message in the console it means the system is ready to accept incoming connections on port 5000: <div class="fragment"><div class="line"><span class="preprocessor">#### Example TCP Echo Server using MMAGIC Controller ####</span></div>
|
|
<div class="line"> </div>
|
|
<div class="line">Opened TCP socket on stream_id 1</div>
|
|
</div><!-- fragment --></li>
|
|
<li>Now log in to the access point using <code>ssh</code> (Alternatively, you can do this from your computer if the access point has been setup in bridged mode.)</li>
|
|
<li>Run the following command on the access point: <div class="fragment"><div class="line">telnet <ip address of system you noted above> 5000</div>
|
|
</div><!-- fragment --></li>
|
|
<li>You should see a message on the controller showing that it has accepted the connection: <div class="fragment"><div class="line">Accepted a TCP connection on stream_id 2</div>
|
|
</div><!-- fragment --></li>
|
|
<li>Type a message into the telnet session and press [ENTER]</li>
|
|
<li>You should see the message echoed back in telnet by the controller.</li>
|
|
<li>You can open multiple telnet sessions this way and note that they each get their own private connection and echo.</li>
|
|
<li>You can end any telnet session by pressing ^]</li>
|
|
<li>Every time you close a telnet session, you should see the following message on the controller: <div class="fragment"><div class="line">Closed TCP socket</div>
|
|
</div><!-- fragment --></li>
|
|
</ul>
|
|
<h3><a class="anchor" id="autotoc_md38"></a>
|
|
Using a Python script</h3>
|
|
<p >For stress testing the TCP echo server, we provide you a <code>tcp_echo_client.py</code> file that you can run to open multiple connections to the TCP echo server on the controller and rapidly send and receive data from it. This script can also open multiple TCP connections in parallel if requested.</p>
|
|
<p >If your AP is configured in bridge mode, then you can run this script from any computer in the network. If not, you will need to copy this script to the access point and run it from a terminal session in the access point.</p>
|
|
<p >Once you see the following message on the controller:</p>
|
|
<p >You can issue the following command from the access point (Or your PC if the access point is configured for bridged mode): </p><div class="fragment"><div class="line">python tcp_echo_client.py -a <ip address of system you noted above> -c 10 -v</div>
|
|
</div><!-- fragment --><p> This will open a connection to the TCP echo server and send and receive 10 packets. The script generates random data to send and verifies the correct data was echoed back by the TCP echo server.</p>
|
|
<p >Run the following command to see all options you can pass to the script. </p><div class="fragment"><div class="line">python tcp_echo_client.py -h</div>
|
|
</div><!-- fragment -->
|
|
<p class="definition">Definition in file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
</div><div class="textblock"><code>#include "mmhal.h"</code><br />
|
|
<code>#include "mmosal.h"</code><br />
|
|
<code>#include "mmutils.h"</code><br />
|
|
<code>#include "mmagic_controller.h"</code><br />
|
|
</div><div class="textblock"><div class="dynheader">
|
|
Include dependency graph for m2m_controller.c:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="m2m__controller_8c__incl.png" border="0" usemap="#am2m__controller_8c" alt=""/></div>
|
|
<map name="am2m__controller_8c" id="am2m__controller_8c">
|
|
<area shape="rect" title="M2M Controller example application." alt="" coords="505,5,639,32"/>
|
|
<area shape="rect" href="mmhal_8h_source.html" title=" " alt="" coords="571,80,651,107"/>
|
|
<area shape="rect" href="mmosal_8h_source.html" title=" " alt="" coords="627,379,714,405"/>
|
|
<area shape="rect" href="mmutils_8h_source.html" title=" " alt="" coords="840,379,928,405"/>
|
|
<area shape="rect" href="mmagic__controller_8h_source.html" title=" " alt="" coords="5,304,160,331"/>
|
|
<area shape="rect" title=" " alt="" coords="429,453,512,480"/>
|
|
<area shape="rect" title=" " alt="" coords="355,379,429,405"/>
|
|
<area shape="rect" title=" " alt="" coords="1027,453,1098,480"/>
|
|
<area shape="rect" title=" " alt="" coords="915,229,979,256"/>
|
|
<area shape="rect" href="mmhal__flash_8h_source.html" title=" " alt="" coords="235,304,354,331"/>
|
|
<area shape="rect" href="mmhal__wlan_8h_source.html" title=" " alt="" coords="575,155,694,181"/>
|
|
<area shape="rect" href="mmpkt_8h_source.html" title=" " alt="" coords="582,304,663,331"/>
|
|
<area shape="rect" href="mmwlan_8h_source.html" title=" " alt="" coords="707,229,797,256"/>
|
|
<area shape="rect" title=" " alt="" coords="536,453,603,480"/>
|
|
<area shape="rect" title=" " alt="" coords="833,453,903,480"/>
|
|
<area shape="rect" title=" " alt="" coords="738,453,809,480"/>
|
|
<area shape="rect" title=" " alt="" coords="627,453,714,480"/>
|
|
<area shape="rect" title=" " alt="" coords="928,453,1003,480"/>
|
|
<area shape="rect" title=" " alt="" coords="22,379,109,405"/>
|
|
</map>
|
|
</div>
|
|
</div>
|
|
<p><a href="m2m__controller_8c_source.html">Go to the source code of this file.</a></p>
|
|
<table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
|
|
Data Structures</h2></td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structbeacon__monitor__thread__args.html">beacon_monitor_thread_args</a></td></tr>
|
|
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Arguments for beacon monitor task. <a href="structbeacon__monitor__thread__args.html#details">More...</a><br /></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="structtcp__echo__server__thread__args.html">tcp_echo_server_thread_args</a></td></tr>
|
|
<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Arguments for TCP echo server task. <a href="structtcp__echo__server__thread__args.html#details">More...</a><br /></td></tr>
|
|
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a>
|
|
Macros</h2></td></tr>
|
|
<tr class="memitem:aaf46549480a528db5ba7d78e7270b5a9"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#aaf46549480a528db5ba7d78e7270b5a9">SSID</a>   MorseMicro</td></tr>
|
|
<tr class="memdesc:aaf46549480a528db5ba7d78e7270b5a9"><td class="mdescLeft"> </td><td class="mdescRight">SSID of the AP to connect to. <a href="m2m__controller_8c.html#aaf46549480a528db5ba7d78e7270b5a9">More...</a><br /></td></tr>
|
|
<tr class="separator:aaf46549480a528db5ba7d78e7270b5a9"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a782948b5f7f887653988cdb4576e41de"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a782948b5f7f887653988cdb4576e41de">SAE_PASSPHRASE</a>   12345678</td></tr>
|
|
<tr class="memdesc:a782948b5f7f887653988cdb4576e41de"><td class="mdescLeft"> </td><td class="mdescRight">Passphrase of the AP (ignored if security type is not SAE). <a href="m2m__controller_8c.html#a782948b5f7f887653988cdb4576e41de">More...</a><br /></td></tr>
|
|
<tr class="separator:a782948b5f7f887653988cdb4576e41de"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9466bf92a0218030cd2dd54cca715e87"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a9466bf92a0218030cd2dd54cca715e87">_STRINGIFY</a>(x)   #x</td></tr>
|
|
<tr class="memdesc:a9466bf92a0218030cd2dd54cca715e87"><td class="mdescLeft"> </td><td class="mdescRight">Stringify macro. <a href="m2m__controller_8c.html#a9466bf92a0218030cd2dd54cca715e87">More...</a><br /></td></tr>
|
|
<tr class="separator:a9466bf92a0218030cd2dd54cca715e87"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a6df1d22fb5f09eccc23b9f399670cfd7"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a6df1d22fb5f09eccc23b9f399670cfd7">STRINGIFY</a>(x)   <a class="el" href="m2m__controller_8c.html#a9466bf92a0218030cd2dd54cca715e87">_STRINGIFY</a>(x)</td></tr>
|
|
<tr class="memdesc:a6df1d22fb5f09eccc23b9f399670cfd7"><td class="mdescLeft"> </td><td class="mdescRight">Convert the content of the given macro to a string. <a href="m2m__controller_8c.html#a6df1d22fb5f09eccc23b9f399670cfd7">More...</a><br /></td></tr>
|
|
<tr class="separator:a6df1d22fb5f09eccc23b9f399670cfd7"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa523388767f01a20584004266c7cea12"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#aa523388767f01a20584004266c7cea12">LINK_STATE_TIMEOUT_MS</a>   20000</td></tr>
|
|
<tr class="memdesc:aa523388767f01a20584004266c7cea12"><td class="mdescLeft"> </td><td class="mdescRight">Duration to wait for the link to be established after WLAN reports connected. <a href="m2m__controller_8c.html#aa523388767f01a20584004266c7cea12">More...</a><br /></td></tr>
|
|
<tr class="separator:aa523388767f01a20584004266c7cea12"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a32dd5e132b45725c3986857077e33751"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a32dd5e132b45725c3986857077e33751">TCP_ECHCO_SERVER_PORT</a>   5000</td></tr>
|
|
<tr class="memdesc:a32dd5e132b45725c3986857077e33751"><td class="mdescLeft"> </td><td class="mdescRight">Port the the TCP echo server will bind to. <a href="m2m__controller_8c.html#a32dd5e132b45725c3986857077e33751">More...</a><br /></td></tr>
|
|
<tr class="separator:a32dd5e132b45725c3986857077e33751"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:ae3d2a3ab5db25ebc600946ed88329584"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#ae3d2a3ab5db25ebc600946ed88329584">agent_start_handler</a> (struct mmagic_controller *controller, void *arg)</td></tr>
|
|
<tr class="memdesc:ae3d2a3ab5db25ebc600946ed88329584"><td class="mdescLeft"> </td><td class="mdescRight">Handler for the "Agent start" callback. <a href="m2m__controller_8c.html#ae3d2a3ab5db25ebc600946ed88329584">More...</a><br /></td></tr>
|
|
<tr class="separator:ae3d2a3ab5db25ebc600946ed88329584"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a1b18cdee34a9f27753292fc69f5df1c8"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a1b18cdee34a9f27753292fc69f5df1c8">wlan_connect</a> (struct mmagic_controller *controller)</td></tr>
|
|
<tr class="memdesc:a1b18cdee34a9f27753292fc69f5df1c8"><td class="mdescLeft"> </td><td class="mdescRight">This function illustrates how to establish a wlan connection using the mmagic_controller interface. <a href="m2m__controller_8c.html#a1b18cdee34a9f27753292fc69f5df1c8">More...</a><br /></td></tr>
|
|
<tr class="separator:a1b18cdee34a9f27753292fc69f5df1c8"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a9aaa8996fe5ec03b1d06d0b3b0838755"><td class="memItemLeft" align="right" valign="top">static bool </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a9aaa8996fe5ec03b1d06d0b3b0838755">is_wlan_connected</a> (struct mmagic_controller *controller)</td></tr>
|
|
<tr class="memdesc:a9aaa8996fe5ec03b1d06d0b3b0838755"><td class="mdescLeft"> </td><td class="mdescRight">This function illustrates how to check if the agent already has an active connection. <a href="m2m__controller_8c.html#a9aaa8996fe5ec03b1d06d0b3b0838755">More...</a><br /></td></tr>
|
|
<tr class="separator:a9aaa8996fe5ec03b1d06d0b3b0838755"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a548c1e72e51bea9abfed79b9d9b97240"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a548c1e72e51bea9abfed79b9d9b97240">beacon_monitor_rx_handler</a> (const struct <a class="el" href="structmmagic__wlan__beacon__rx__event__args.html">mmagic_wlan_beacon_rx_event_args</a> *args, void *arg)</td></tr>
|
|
<tr class="memdesc:a548c1e72e51bea9abfed79b9d9b97240"><td class="mdescLeft"> </td><td class="mdescRight">Handler for the beacon monitor event handler callback. <a href="m2m__controller_8c.html#a548c1e72e51bea9abfed79b9d9b97240">More...</a><br /></td></tr>
|
|
<tr class="separator:a548c1e72e51bea9abfed79b9d9b97240"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:afabe397b761752e5057390e230bfd09a"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#afabe397b761752e5057390e230bfd09a">beacon_monitor_example_start</a> (struct mmagic_controller *controller)</td></tr>
|
|
<tr class="memdesc:afabe397b761752e5057390e230bfd09a"><td class="mdescLeft"> </td><td class="mdescRight">This function illustrates how to subscribe to and receive custom vendor IEs from beacons. <a href="m2m__controller_8c.html#afabe397b761752e5057390e230bfd09a">More...</a><br /></td></tr>
|
|
<tr class="separator:afabe397b761752e5057390e230bfd09a"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:ac5b07133cdd8ab4e5801325b6fe128c0"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#ac5b07133cdd8ab4e5801325b6fe128c0">tcp_client_example</a> (struct mmagic_controller *controller)</td></tr>
|
|
<tr class="memdesc:ac5b07133cdd8ab4e5801325b6fe128c0"><td class="mdescLeft"> </td><td class="mdescRight">This function illustrates how to open a tcp client, send and receive some data and close the connection. <a href="m2m__controller_8c.html#ac5b07133cdd8ab4e5801325b6fe128c0">More...</a><br /></td></tr>
|
|
<tr class="separator:ac5b07133cdd8ab4e5801325b6fe128c0"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a07fee81f3de7a7d8cdaf86ec4e69ba79"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a07fee81f3de7a7d8cdaf86ec4e69ba79">tcp_echo_server_task</a> (void *args)</td></tr>
|
|
<tr class="memdesc:a07fee81f3de7a7d8cdaf86ec4e69ba79"><td class="mdescLeft"> </td><td class="mdescRight">This task handles a single incoming TCP connection. <a href="m2m__controller_8c.html#a07fee81f3de7a7d8cdaf86ec4e69ba79">More...</a><br /></td></tr>
|
|
<tr class="separator:a07fee81f3de7a7d8cdaf86ec4e69ba79"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5afdc579172347833b456810f819744e"><td class="memItemLeft" align="right" valign="top">static enum <a class="el" href="group__MMAGIC__CONTROLLER__DATA__TYPES.html#gad2f6cd96ec8731a96031b0b5614f9f92">mmagic_status</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a5afdc579172347833b456810f819744e">tcp_echo_server_start</a> (struct mmagic_controller *controller, uint16_t port)</td></tr>
|
|
<tr class="memdesc:a5afdc579172347833b456810f819744e"><td class="mdescLeft"> </td><td class="mdescRight">This function illustrates how to start a TCP server and listen for a connection. <a href="m2m__controller_8c.html#a5afdc579172347833b456810f819744e">More...</a><br /></td></tr>
|
|
<tr class="separator:a5afdc579172347833b456810f819744e"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0e6036372ca4894444a7fdec035929ca"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a0e6036372ca4894444a7fdec035929ca">run_examples_task</a> (void *args)</td></tr>
|
|
<tr class="memdesc:a0e6036372ca4894444a7fdec035929ca"><td class="mdescLeft"> </td><td class="mdescRight">Runs the examples. <a href="m2m__controller_8c.html#a0e6036372ca4894444a7fdec035929ca">More...</a><br /></td></tr>
|
|
<tr class="separator:a0e6036372ca4894444a7fdec035929ca"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:add3190cf715f513666f4be42874d91e2"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#add3190cf715f513666f4be42874d91e2">app_init</a> (void)</td></tr>
|
|
<tr class="memdesc:add3190cf715f513666f4be42874d91e2"><td class="mdescLeft"> </td><td class="mdescRight">Main entry point to the application. <a href="m2m__controller_8c.html#add3190cf715f513666f4be42874d91e2">More...</a><br /></td></tr>
|
|
<tr class="separator:add3190cf715f513666f4be42874d91e2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table><table class="memberdecls">
|
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="var-members" name="var-members"></a>
|
|
Variables</h2></td></tr>
|
|
<tr class="memitem:a126582c7db4ae7352929162212ca9382"><td class="memItemLeft" align="right" valign="top">static struct mmosal_semb * </td><td class="memItemRight" valign="bottom"><a class="el" href="m2m__controller_8c.html#a126582c7db4ae7352929162212ca9382">agent_started_semb</a> = NULL</td></tr>
|
|
<tr class="memdesc:a126582c7db4ae7352929162212ca9382"><td class="mdescLeft"> </td><td class="mdescRight">Binary semaphore used to indicate when an agent start notification has been received. <a href="m2m__controller_8c.html#a126582c7db4ae7352929162212ca9382">More...</a><br /></td></tr>
|
|
<tr class="separator:a126582c7db4ae7352929162212ca9382"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<h2 class="groupheader">Macro Definition Documentation</h2>
|
|
<a id="a9466bf92a0218030cd2dd54cca715e87" name="a9466bf92a0218030cd2dd54cca715e87"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a9466bf92a0218030cd2dd54cca715e87">◆ </a></span>_STRINGIFY</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define _STRINGIFY</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> </td>
|
|
<td class="paramname">x</td><td>)</td>
|
|
<td>   #x</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Stringify macro. </p>
|
|
<p >Do not use directly; use <a class="el" href="softap_8c.html#a6df1d22fb5f09eccc23b9f399670cfd7">STRINGIFY()</a>. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00183">183</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa523388767f01a20584004266c7cea12" name="aa523388767f01a20584004266c7cea12"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa523388767f01a20584004266c7cea12">◆ </a></span>LINK_STATE_TIMEOUT_MS</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define LINK_STATE_TIMEOUT_MS   20000</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Duration to wait for the link to be established after WLAN reports connected. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00188">188</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a782948b5f7f887653988cdb4576e41de" name="a782948b5f7f887653988cdb4576e41de"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a782948b5f7f887653988cdb4576e41de">◆ </a></span>SAE_PASSPHRASE</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define SAE_PASSPHRASE   12345678</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Passphrase of the AP (ignored if security type is not SAE). </p>
|
|
<p >(Do not quote; it will be stringified.) </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00179">179</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aaf46549480a528db5ba7d78e7270b5a9" name="aaf46549480a528db5ba7d78e7270b5a9"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aaf46549480a528db5ba7d78e7270b5a9">◆ </a></span>SSID</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define SSID   MorseMicro</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>SSID of the AP to connect to. </p>
|
|
<p >(Do not quote; it will be stringified.) </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00172">172</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a6df1d22fb5f09eccc23b9f399670cfd7" name="a6df1d22fb5f09eccc23b9f399670cfd7"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a6df1d22fb5f09eccc23b9f399670cfd7">◆ </a></span>STRINGIFY</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define STRINGIFY</td>
|
|
<td>(</td>
|
|
<td class="paramtype"> </td>
|
|
<td class="paramname">x</td><td>)</td>
|
|
<td>   <a class="el" href="m2m__controller_8c.html#a9466bf92a0218030cd2dd54cca715e87">_STRINGIFY</a>(x)</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Convert the content of the given macro to a string. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00185">185</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a32dd5e132b45725c3986857077e33751" name="a32dd5e132b45725c3986857077e33751"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a32dd5e132b45725c3986857077e33751">◆ </a></span>TCP_ECHCO_SERVER_PORT</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">#define TCP_ECHCO_SERVER_PORT   5000</td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Port the the TCP echo server will bind to. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00191">191</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<a id="ae3d2a3ab5db25ebc600946ed88329584" name="ae3d2a3ab5db25ebc600946ed88329584"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ae3d2a3ab5db25ebc600946ed88329584">◆ </a></span>agent_start_handler()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void agent_start_handler </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct mmagic_controller * </td>
|
|
<td class="paramname"><em>controller</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"><em>arg</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Handler for the "Agent start" callback. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">controller</td><td>Controller instance handle. </td></tr>
|
|
<tr><td class="paramname">arg</td><td>Opaque argument that was given at the time of callback registration. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00199">199</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="add3190cf715f513666f4be42874d91e2" name="add3190cf715f513666f4be42874d91e2"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#add3190cf715f513666f4be42874d91e2">◆ </a></span>app_init()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void app_init </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Main entry point to the application. </p>
|
|
<p >This will be invoked in a thread once operating system and hardware initialization has completed. It may return, but it does not have to. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00734">734</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="afabe397b761752e5057390e230bfd09a" name="afabe397b761752e5057390e230bfd09a"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#afabe397b761752e5057390e230bfd09a">◆ </a></span>beacon_monitor_example_start()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void beacon_monitor_example_start </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct mmagic_controller * </td>
|
|
<td class="paramname"><em>controller</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This function illustrates how to subscribe to and receive custom vendor IEs from beacons. </p>
|
|
<p >See <code>beacon_stuffing</code> example application for more information.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">controller</td><td>Reference to the controller structure to use. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00419">419</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a548c1e72e51bea9abfed79b9d9b97240" name="a548c1e72e51bea9abfed79b9d9b97240"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a548c1e72e51bea9abfed79b9d9b97240">◆ </a></span>beacon_monitor_rx_handler()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void beacon_monitor_rx_handler </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const struct <a class="el" href="structmmagic__wlan__beacon__rx__event__args.html">mmagic_wlan_beacon_rx_event_args</a> * </td>
|
|
<td class="paramname"><em>args</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"><em>arg</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Handler for the beacon monitor event handler callback. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">args</td><td>The event arguments from the Agent. </td></tr>
|
|
<tr><td class="paramname">arg</td><td>Opaque argument that was registered along with the handler. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00373">373</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a9aaa8996fe5ec03b1d06d0b3b0838755" name="a9aaa8996fe5ec03b1d06d0b3b0838755"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a9aaa8996fe5ec03b1d06d0b3b0838755">◆ </a></span>is_wlan_connected()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static bool is_wlan_connected </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct mmagic_controller * </td>
|
|
<td class="paramname"><em>controller</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This function illustrates how to check if the agent already has an active connection. </p>
|
|
<p >Useful when the controller has restarted and reattaches to the agent.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">controller</td><td>Reference to the controller structure to use.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> is a wlan connection and link was established else <code>false</code> </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00282">282</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a0e6036372ca4894444a7fdec035929ca" name="a0e6036372ca4894444a7fdec035929ca"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0e6036372ca4894444a7fdec035929ca">◆ </a></span>run_examples_task()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void run_examples_task </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"><em>args</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Runs the examples. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">args</td><td>Not used. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00660">660</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ac5b07133cdd8ab4e5801325b6fe128c0" name="ac5b07133cdd8ab4e5801325b6fe128c0"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ac5b07133cdd8ab4e5801325b6fe128c0">◆ </a></span>tcp_client_example()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void tcp_client_example </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct mmagic_controller * </td>
|
|
<td class="paramname"><em>controller</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This function illustrates how to open a tcp client, send and receive some data and close the connection. </p>
|
|
<p >It is currently hitting a http web-page so we just expect a very basic response from the http server.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">controller</td><td>Reference to the controller structure to use. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00451">451</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a5afdc579172347833b456810f819744e" name="a5afdc579172347833b456810f819744e"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5afdc579172347833b456810f819744e">◆ </a></span>tcp_echo_server_start()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static enum <a class="el" href="group__MMAGIC__CONTROLLER__DATA__TYPES.html#gad2f6cd96ec8731a96031b0b5614f9f92">mmagic_status</a> tcp_echo_server_start </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct mmagic_controller * </td>
|
|
<td class="paramname"><em>controller</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">uint16_t </td>
|
|
<td class="paramname"><em>port</em> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This function illustrates how to start a TCP server and listen for a connection. </p>
|
|
<p >It will echo back anything received on the connection once established.</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">controller</td><td>Reference to the controller structure to use. </td></tr>
|
|
<tr><td class="paramname">port</td><td>The TCP port to bind to.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="group__MMAGIC__CONTROLLER__DATA__TYPES.html#ggad2f6cd96ec8731a96031b0b5614f9f92a264721ca9a0fee67500a999090f98ce0">MMAGIC_STATUS_OK</a> else an appropriate error code. </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00598">598</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a07fee81f3de7a7d8cdaf86ec4e69ba79" name="a07fee81f3de7a7d8cdaf86ec4e69ba79"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a07fee81f3de7a7d8cdaf86ec4e69ba79">◆ </a></span>tcp_echo_server_task()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void tcp_echo_server_task </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void * </td>
|
|
<td class="paramname"><em>args</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This task handles a single incoming TCP connection. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">args</td><td>The arguments for this task. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00525">525</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a1b18cdee34a9f27753292fc69f5df1c8" name="a1b18cdee34a9f27753292fc69f5df1c8"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a1b18cdee34a9f27753292fc69f5df1c8">◆ </a></span>wlan_connect()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static bool wlan_connect </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct mmagic_controller * </td>
|
|
<td class="paramname"><em>controller</em></td><td>)</td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>This function illustrates how to establish a wlan connection using the mmagic_controller interface. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">controller</td><td>Reference to the controller structure to use.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd><code>true</code> is a wlan connection and link was established else <code>false</code> </dd></dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00218">218</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Variable Documentation</h2>
|
|
<a id="a126582c7db4ae7352929162212ca9382" name="a126582c7db4ae7352929162212ca9382"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a126582c7db4ae7352929162212ca9382">◆ </a></span>agent_started_semb</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">struct mmosal_semb* agent_started_semb = NULL</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
|
|
<p>Binary semaphore used to indicate when an agent start notification has been received. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="m2m__controller_8c_source.html#l00208">208</a> of file <a class="el" href="m2m__controller_8c_source.html">m2m_controller.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
</div><!-- contents -->
|
|
</div><!-- doc-content -->
|
|
<!-- HTML footer for doxygen 1.8.17-->
|
|
<!-- start footer part -->
|
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
|
<ul>
|
|
<li class="navelem"><a class="el" href="dir_a83e6f5a895aa2b1b9491908a242dbc1.html">applications</a></li><li class="navelem"><a class="el" href="dir_cfc5c4d031258b3410140d72aa2dcc6a.html">mm-ekh08-u575</a></li><li class="navelem"><a class="el" href="dir_539444a2780e79e27bb34b1485e8d1f4.html">m2m_controller</a></li><li class="navelem"><a class="el" href="dir_8b383e3f0fccc0a9a92eeea2bbf13eff.html">src</a></li><li class="navelem"><a class="el" href="m2m__controller_8c.html">m2m_controller.c</a></li>
|
|
<li class="footer">Copyright 2021 Morse Micro </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|