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.
522 lines
30 KiB
HTML
522 lines
30 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: http.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('http_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="#func-members">Functions</a> |
|
|
<a href="#var-members">Variables</a> </div>
|
|
<div class="headertitle"><div class="title">http.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 >HTTP server example, with APIs for RESTful interfaces. </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>This file contains examples on how to use the lwIP http server. It supports static and dynamically generated pages.</p>
|
|
<p >Static pages are specified in the <code>fs/</code> directory, and on compilation will be automatically converted to C arrays which will be embedded into the binary. Currently the file converter is compiled to run only on x86 linux systems. To support other systems, <code>htmlgen</code> can be recompiled on your development machine from the mainline lwIP sources.</p>
|
|
<p >Dynamic pages are specified through the custom file system, <code>restfs</code>, and are registered by specifying the URI and handler function in the <code>rest_endpoints</code> array.</p>
|
|
<p >Note that only GET requests are supported at this time.</p>
|
|
<p >To view the web-page, navigate to </p><div class="fragment"><div class="line">http:<span class="comment">//<device_ip>/index.html</span></div>
|
|
</div><!-- fragment --><p> on a computer with a route to the Morse Micro IoT device, over HaLow. Alternatively, you can run </p><div class="fragment"><div class="line">curl http:<span class="comment">//<device_ip>/index.html</span></div>
|
|
</div><!-- fragment --><p> from the AP that the device is connected to.</p>
|
|
<p >See <a class="el" href="mm__app__common_8h.html#APP_COMMON_API">Application helper routines for Wireless LAN interface</a> for details of WLAN and IP stack configuration. </p>
|
|
|
|
<p class="definition">Definition in file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
</div><div class="textblock"><code>#include <string.h></code><br />
|
|
<code>#include "mmosal.h"</code><br />
|
|
<code>#include "mmwlan.h"</code><br />
|
|
<code>#include "mmipal.h"</code><br />
|
|
<code>#include "lwip/apps/httpd.h"</code><br />
|
|
<code>#include "lwip/def.h"</code><br />
|
|
<code>#include "lwip/mem.h"</code><br />
|
|
<code>#include "lwip/tcpip.h"</code><br />
|
|
<code>#include "restfs.h"</code><br />
|
|
<code>#include "mm_app_common.h"</code><br />
|
|
</div><div class="textblock"><div class="dynheader">
|
|
Include dependency graph for http.c:</div>
|
|
<div class="dyncontent">
|
|
<div class="center"><img src="http_8c__incl.png" border="0" usemap="#ahttp_8c" alt=""/></div>
|
|
<map name="ahttp_8c" id="ahttp_8c">
|
|
<area shape="rect" title="HTTP server example, with APIs for RESTful interfaces." alt="" coords="686,5,745,32"/>
|
|
<area shape="rect" title=" " alt="" coords="5,304,76,331"/>
|
|
<area shape="rect" href="mmosal_8h_source.html" title=" " alt="" coords="187,229,273,256"/>
|
|
<area shape="rect" href="mmwlan_8h_source.html" title=" " alt="" coords="335,80,426,107"/>
|
|
<area shape="rect" href="mmipal_8h_source.html" title=" " alt="" coords="600,229,684,256"/>
|
|
<area shape="rect" title=" " alt="" coords="701,80,836,107"/>
|
|
<area shape="rect" title=" " alt="" coords="861,80,946,107"/>
|
|
<area shape="rect" title=" " alt="" coords="970,80,1069,107"/>
|
|
<area shape="rect" title=" " alt="" coords="1093,80,1191,107"/>
|
|
<area shape="rect" href="restfs_8h_source.html" title=" " alt="" coords="668,155,739,181"/>
|
|
<area shape="rect" title=" " alt="" coords="1215,80,1370,107"/>
|
|
<area shape="rect" title=" " alt="" coords="397,304,479,331"/>
|
|
<area shape="rect" title=" " alt="" coords="527,304,597,331"/>
|
|
<area shape="rect" title=" " alt="" coords="306,304,373,331"/>
|
|
<area shape="rect" title=" " alt="" coords="100,304,171,331"/>
|
|
<area shape="rect" title=" " alt="" coords="195,304,281,331"/>
|
|
<area shape="rect" title=" " alt="" coords="343,155,418,181"/>
|
|
<area shape="rect" href="mmpkt_8h_source.html" title=" " alt="" coords="443,155,524,181"/>
|
|
<area shape="rect" title=" " alt="" coords="399,229,474,256"/>
|
|
</map>
|
|
</div>
|
|
</div>
|
|
<p><a href="http_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="func-members" name="func-members"></a>
|
|
Functions</h2></td></tr>
|
|
<tr class="memitem:a29e292994e6a0ea7ede541fb48129c28"><td class="memItemLeft" align="right" valign="top">static const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="http_8c.html#a29e292994e6a0ea7ede541fb48129c28">cgi_set_string</a> (int index, int nparams, char *params[], char *values[])</td></tr>
|
|
<tr class="memdesc:a29e292994e6a0ea7ede541fb48129c28"><td class="mdescLeft"> </td><td class="mdescRight">Example CGI handler to set a global variable based on query parameters. <a href="http_8c.html#a29e292994e6a0ea7ede541fb48129c28">More...</a><br /></td></tr>
|
|
<tr class="separator:a29e292994e6a0ea7ede541fb48129c28"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a8efd516d157641e49967757a29398e78"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="http_8c.html#a8efd516d157641e49967757a29398e78">rest_ep_getstring</a> (struct <a class="el" href="structrestfs__file.html">restfs_file</a> *fil)</td></tr>
|
|
<tr class="memdesc:a8efd516d157641e49967757a29398e78"><td class="mdescLeft"> </td><td class="mdescRight">Get the string previously set by set_string. <a href="http_8c.html#a8efd516d157641e49967757a29398e78">More...</a><br /></td></tr>
|
|
<tr class="separator:a8efd516d157641e49967757a29398e78"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a5e78c15bf26a6a46d0c1917dc2ae2b6b"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="http_8c.html#a5e78c15bf26a6a46d0c1917dc2ae2b6b">rest_ep_success</a> (struct <a class="el" href="structrestfs__file.html">restfs_file</a> *fil)</td></tr>
|
|
<tr class="memdesc:a5e78c15bf26a6a46d0c1917dc2ae2b6b"><td class="mdescLeft"> </td><td class="mdescRight">Example endpoint to return fixed html string. <a href="http_8c.html#a5e78c15bf26a6a46d0c1917dc2ae2b6b">More...</a><br /></td></tr>
|
|
<tr class="separator:a5e78c15bf26a6a46d0c1917dc2ae2b6b"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a0092ad2e1a796a2d7b854407eb57dcc4"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="http_8c.html#a0092ad2e1a796a2d7b854407eb57dcc4">rest_ep_failed</a> (struct <a class="el" href="structrestfs__file.html">restfs_file</a> *fil)</td></tr>
|
|
<tr class="memdesc:a0092ad2e1a796a2d7b854407eb57dcc4"><td class="mdescLeft"> </td><td class="mdescRight">Example endpoint to return fixed html string. <a href="http_8c.html#a0092ad2e1a796a2d7b854407eb57dcc4">More...</a><br /></td></tr>
|
|
<tr class="separator:a0092ad2e1a796a2d7b854407eb57dcc4"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:aa5cdf7a2924c56223879443f073320e0"><td class="memItemLeft" align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="http_8c.html#aa5cdf7a2924c56223879443f073320e0">rest_ep_hello</a> (struct <a class="el" href="structrestfs__file.html">restfs_file</a> *fil)</td></tr>
|
|
<tr class="memdesc:aa5cdf7a2924c56223879443f073320e0"><td class="mdescLeft"> </td><td class="mdescRight">Hello world example endpoint. <a href="http_8c.html#aa5cdf7a2924c56223879443f073320e0">More...</a><br /></td></tr>
|
|
<tr class="separator:aa5cdf7a2924c56223879443f073320e0"><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="http_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="http_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:ab69b43e3f6d0dbfefde2f79a17614de2"><td class="memItemLeft" align="right" valign="top">static char </td><td class="memItemRight" valign="bottom"><a class="el" href="http_8c.html#ab69b43e3f6d0dbfefde2f79a17614de2">cgi_string</a> [32] = {0}</td></tr>
|
|
<tr class="memdesc:ab69b43e3f6d0dbfefde2f79a17614de2"><td class="mdescLeft"> </td><td class="mdescRight">Buffer to store the string set by <a class="el" href="http_8c.html#a29e292994e6a0ea7ede541fb48129c28" title="Example CGI handler to set a global variable based on query parameters.">cgi_set_string()</a> <a href="http_8c.html#ab69b43e3f6d0dbfefde2f79a17614de2">More...</a><br /></td></tr>
|
|
<tr class="separator:ab69b43e3f6d0dbfefde2f79a17614de2"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a316c878e8a9495823996ed4d0d069656"><td class="memItemLeft" align="right" valign="top">static const struct <a class="el" href="structrest__endpoint.html">rest_endpoint</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="http_8c.html#a316c878e8a9495823996ed4d0d069656">rest_endpoints</a> []</td></tr>
|
|
<tr class="memdesc:a316c878e8a9495823996ed4d0d069656"><td class="mdescLeft"> </td><td class="mdescRight">Vector table of rest endpoints. <a href="http_8c.html#a316c878e8a9495823996ed4d0d069656">More...</a><br /></td></tr>
|
|
<tr class="separator:a316c878e8a9495823996ed4d0d069656"><td class="memSeparator" colspan="2"> </td></tr>
|
|
<tr class="memitem:a65c26d4ef8c8cea949bf4becff2468be"><td class="memItemLeft" align="right" valign="top">static const tCGI </td><td class="memItemRight" valign="bottom"><a class="el" href="http_8c.html#a65c26d4ef8c8cea949bf4becff2468be">cgi_endpoints</a> []</td></tr>
|
|
<tr class="memdesc:a65c26d4ef8c8cea949bf4becff2468be"><td class="mdescLeft"> </td><td class="mdescRight">Vector table of LWIP CGI endpoints. <a href="http_8c.html#a65c26d4ef8c8cea949bf4becff2468be">More...</a><br /></td></tr>
|
|
<tr class="separator:a65c26d4ef8c8cea949bf4becff2468be"><td class="memSeparator" colspan="2"> </td></tr>
|
|
</table>
|
|
<h2 class="groupheader">Function Documentation</h2>
|
|
<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="http_8c_source.html#l00172">172</a> of file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a29e292994e6a0ea7ede541fb48129c28" name="a29e292994e6a0ea7ede541fb48129c28"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a29e292994e6a0ea7ede541fb48129c28">◆ </a></span>cgi_set_string()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static const char * cgi_set_string </td>
|
|
<td>(</td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"><em>index</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"><em>nparams</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"><em>params</em>[], </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">char * </td>
|
|
<td class="paramname"><em>values</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>Example CGI handler to set a global variable based on query parameters. </p>
|
|
<p >Query string expected as <code>value=<string to set></code>; e.g., <code>/rest/set_string</code>?value=test</p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">index</td><td>The index of the endpoint in the CGI handlers table. </td></tr>
|
|
<tr><td class="paramname">nparams</td><td>Number of elements in <code>params</code> provided in the URI. </td></tr>
|
|
<tr><td class="paramname">params</td><td>Parameter names provided in the URI. </td></tr>
|
|
<tr><td class="paramname">values</td><td>Values corresponding to each parameter given in the URI.</td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
<dl class="section return"><dt>Returns</dt><dd>the URI of the response to return (which can be a REST endpoint).</dd></dl>
|
|
<dl class="section note"><dt>Note</dt><dd>Strictly speaking GET requests should not be altering state on the server, but for this example we will use it as a lightweight alternative to POST.</dd></dl>
|
|
<p>See lwIP <code>httpd</code> for more information </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="http_8c_source.html#l00079">79</a> of file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a0092ad2e1a796a2d7b854407eb57dcc4" name="a0092ad2e1a796a2d7b854407eb57dcc4"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a0092ad2e1a796a2d7b854407eb57dcc4">◆ </a></span>rest_ep_failed()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void rest_ep_failed </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct <a class="el" href="structrestfs__file.html">restfs_file</a> * </td>
|
|
<td class="paramname"><em>fil</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>Example endpoint to return fixed html string. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">fil</td><td>File to write to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="http_8c_source.html#l00126">126</a> of file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a8efd516d157641e49967757a29398e78" name="a8efd516d157641e49967757a29398e78"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a8efd516d157641e49967757a29398e78">◆ </a></span>rest_ep_getstring()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void rest_ep_getstring </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct <a class="el" href="structrestfs__file.html">restfs_file</a> * </td>
|
|
<td class="paramname"><em>fil</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>Get the string previously set by set_string. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">fil</td><td>File to write to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="http_8c_source.html#l00102">102</a> of file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="aa5cdf7a2924c56223879443f073320e0" name="aa5cdf7a2924c56223879443f073320e0"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#aa5cdf7a2924c56223879443f073320e0">◆ </a></span>rest_ep_hello()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void rest_ep_hello </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct <a class="el" href="structrestfs__file.html">restfs_file</a> * </td>
|
|
<td class="paramname"><em>fil</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>Hello world example endpoint. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">fil</td><td>File to write to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="http_8c_source.html#l00138">138</a> of file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a5e78c15bf26a6a46d0c1917dc2ae2b6b" name="a5e78c15bf26a6a46d0c1917dc2ae2b6b"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a5e78c15bf26a6a46d0c1917dc2ae2b6b">◆ </a></span>rest_ep_success()</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">static void rest_ep_success </td>
|
|
<td>(</td>
|
|
<td class="paramtype">struct <a class="el" href="structrestfs__file.html">restfs_file</a> * </td>
|
|
<td class="paramname"><em>fil</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>Example endpoint to return fixed html string. </p>
|
|
<dl class="params"><dt>Parameters</dt><dd>
|
|
<table class="params">
|
|
<tr><td class="paramname">fil</td><td>File to write to. </td></tr>
|
|
</table>
|
|
</dd>
|
|
</dl>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="http_8c_source.html#l00114">114</a> of file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<h2 class="groupheader">Variable Documentation</h2>
|
|
<a id="a65c26d4ef8c8cea949bf4becff2468be" name="a65c26d4ef8c8cea949bf4becff2468be"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a65c26d4ef8c8cea949bf4becff2468be">◆ </a></span>cgi_endpoints</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const tCGI cgi_endpoints[]</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<b>Initial value:</b><div class="fragment"><div class="line">= {</div>
|
|
<div class="line"> {<span class="stringliteral">"/rest/set_string"</span>, <a class="code hl_function" href="http_8c.html#a29e292994e6a0ea7ede541fb48129c28">cgi_set_string</a>}</div>
|
|
<div class="line">}</div>
|
|
<div class="ttc" id="ahttp_8c_html_a29e292994e6a0ea7ede541fb48129c28"><div class="ttname"><a href="http_8c.html#a29e292994e6a0ea7ede541fb48129c28">cgi_set_string</a></div><div class="ttdeci">static const char * cgi_set_string(int index, int nparams, char *params[], char *values[])</div><div class="ttdoc">Example CGI handler to set a global variable based on query parameters.</div><div class="ttdef"><b>Definition:</b> <a href="http_8c_source.html#l00079">http.c:79</a></div></div>
|
|
</div><!-- fragment -->
|
|
<p>Vector table of LWIP CGI endpoints. </p>
|
|
<p >Declare the URI and handlers for CGI endpoints here</p>
|
|
<p >Will pass query parameters to function call. For example, <code><ip_address>/rest/<endpoint>?queryname=queryval&queryname2=queryval2</code> ... etc. </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="http_8c_source.html#l00163">163</a> of file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="ab69b43e3f6d0dbfefde2f79a17614de2" name="ab69b43e3f6d0dbfefde2f79a17614de2"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#ab69b43e3f6d0dbfefde2f79a17614de2">◆ </a></span>cgi_string</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">char cgi_string[32] = {0}</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>Buffer to store the string set by <a class="el" href="http_8c.html#a29e292994e6a0ea7ede541fb48129c28" title="Example CGI handler to set a global variable based on query parameters.">cgi_set_string()</a> </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="http_8c_source.html#l00061">61</a> of file <a class="el" href="http_8c_source.html">http.c</a>.</p>
|
|
|
|
</div>
|
|
</div>
|
|
<a id="a316c878e8a9495823996ed4d0d069656" name="a316c878e8a9495823996ed4d0d069656"></a>
|
|
<h2 class="memtitle"><span class="permalink"><a href="#a316c878e8a9495823996ed4d0d069656">◆ </a></span>rest_endpoints</h2>
|
|
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="mlabels">
|
|
<tr>
|
|
<td class="mlabels-left">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const struct <a class="el" href="structrest__endpoint.html">rest_endpoint</a> rest_endpoints[]</td>
|
|
</tr>
|
|
</table>
|
|
</td>
|
|
<td class="mlabels-right">
|
|
<span class="mlabels"><span class="mlabel">static</span></span> </td>
|
|
</tr>
|
|
</table>
|
|
</div><div class="memdoc">
|
|
<b>Initial value:</b><div class="fragment"><div class="line">= {</div>
|
|
<div class="line"> {<span class="stringliteral">"success.html"</span>, <a class="code hl_function" href="http_8c.html#a5e78c15bf26a6a46d0c1917dc2ae2b6b">rest_ep_success</a>},</div>
|
|
<div class="line"> {<span class="stringliteral">"failed.html"</span>, <a class="code hl_function" href="http_8c.html#a0092ad2e1a796a2d7b854407eb57dcc4">rest_ep_failed</a>},</div>
|
|
<div class="line"> {<span class="stringliteral">"/rest/hello"</span>, <a class="code hl_function" href="http_8c.html#aa5cdf7a2924c56223879443f073320e0">rest_ep_hello</a>},</div>
|
|
<div class="line"> {<span class="stringliteral">"/rest/get_string.txt"</span>, <a class="code hl_function" href="http_8c.html#a8efd516d157641e49967757a29398e78">rest_ep_getstring</a>},</div>
|
|
<div class="line">}</div>
|
|
<div class="ttc" id="ahttp_8c_html_a0092ad2e1a796a2d7b854407eb57dcc4"><div class="ttname"><a href="http_8c.html#a0092ad2e1a796a2d7b854407eb57dcc4">rest_ep_failed</a></div><div class="ttdeci">static void rest_ep_failed(struct restfs_file *fil)</div><div class="ttdoc">Example endpoint to return fixed html string.</div><div class="ttdef"><b>Definition:</b> <a href="http_8c_source.html#l00126">http.c:126</a></div></div>
|
|
<div class="ttc" id="ahttp_8c_html_a5e78c15bf26a6a46d0c1917dc2ae2b6b"><div class="ttname"><a href="http_8c.html#a5e78c15bf26a6a46d0c1917dc2ae2b6b">rest_ep_success</a></div><div class="ttdeci">static void rest_ep_success(struct restfs_file *fil)</div><div class="ttdoc">Example endpoint to return fixed html string.</div><div class="ttdef"><b>Definition:</b> <a href="http_8c_source.html#l00114">http.c:114</a></div></div>
|
|
<div class="ttc" id="ahttp_8c_html_a8efd516d157641e49967757a29398e78"><div class="ttname"><a href="http_8c.html#a8efd516d157641e49967757a29398e78">rest_ep_getstring</a></div><div class="ttdeci">static void rest_ep_getstring(struct restfs_file *fil)</div><div class="ttdoc">Get the string previously set by set_string.</div><div class="ttdef"><b>Definition:</b> <a href="http_8c_source.html#l00102">http.c:102</a></div></div>
|
|
<div class="ttc" id="ahttp_8c_html_aa5cdf7a2924c56223879443f073320e0"><div class="ttname"><a href="http_8c.html#aa5cdf7a2924c56223879443f073320e0">rest_ep_hello</a></div><div class="ttdeci">static void rest_ep_hello(struct restfs_file *fil)</div><div class="ttdoc">Hello world example endpoint.</div><div class="ttdef"><b>Definition:</b> <a href="http_8c_source.html#l00138">http.c:138</a></div></div>
|
|
</div><!-- fragment -->
|
|
<p>Vector table of rest endpoints. </p>
|
|
<p >Declare the URI and handlers for REST endpoints here.</p>
|
|
<p >For example, HTTP GET on <code><ip address>/rest/example_endpoint</code> </p>
|
|
|
|
<p class="definition">Definition at line <a class="el" href="http_8c_source.html#l00150">150</a> of file <a class="el" href="http_8c_source.html">http.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_91b8f418cff946e8d8b598a9068417a8.html">examples</a></li><li class="navelem"><a class="el" href="dir_b2c963e390268e90a1f13ec7009c5042.html">http</a></li><li class="navelem"><a class="el" href="dir_ff1de81b8776770ebbb629b15d51a986.html">src</a></li><li class="navelem"><a class="el" href="http_8c.html">http.c</a></li>
|
|
<li class="footer">Copyright 2021 Morse Micro </li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|