ardupilot/libraries/doc/html/menu_8h.html

215 lines
12 KiB
HTML

<!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"/>
<title>ArduPilot Libraries: menu.h File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.7.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul class="tablist">
<li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File&nbsp;List</span></a></li>
<li><a href="globals.html"><span>File&nbsp;Members</span></a></li>
</ul>
</div>
</div>
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> </div>
<div class="headertitle">
<h1>menu.h File Reference</h1> </div>
</div>
<div class="contents">
<p>Simple commandline menu subsystem. The <a class="el" href="class_menu.html" title="Class defining and handling one menu tree.">Menu</a> class implements a simple CLI that accepts commands typed by the user, and passes the arguments to those commands to a function defined as handing the command.
<a href="#_details">More...</a></p>
<div class="dynheader">
This graph shows which files directly or indirectly include this file:</div>
<div class="dyncontent">
<div class="center"><img src="menu_8h__dep__incl.png" border="0" usemap="#menu_8hdep" alt=""/></div>
<map name="menu_8hdep" id="menu_8hdep">
<area shape="rect" id="node3" href="_a_p___common_8h.html" title="Common definitions and utility routines for the ArduPilot libraries." alt="" coords="264,83,381,112"/><area shape="rect" id="node7" href="menu_8cpp.html" title="menu.cpp" alt="" coords="5,160,91,189"/><area shape="rect" id="node5" href="_a_p___common_8cpp.html" title="Common utility routines for the ArduPilot libraries." alt="" coords="115,160,245,189"/><area shape="rect" id="node9" href="_a_p___e_e_prom_8h.html" title="AP_EEProm.h" alt="" coords="269,160,376,189"/><area shape="rect" id="node13" href="_a_p___rc_channel_8h.html" title="AP_RcChannel manager." alt="" coords="301,237,427,267"/><area shape="rect" id="node15" href="_a_p___rc_channel_8cpp.html" title="AP_RcChannel.cpp" alt="" coords="344,315,483,344"/><area shape="rect" id="node17" href="_a_p___i_m_u___oilpan_8cpp.html" title="AP_IMU_Oilpan.cpp" alt="" coords="501,160,645,189"/><area shape="rect" id="node11" href="_a_p___e_e_prom_8cpp.html" title="AP_EEProm.cpp" alt="" coords="155,237,277,267"/></map>
</div>
<p><a href="menu_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_menu.html">Menu</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class defining and handling one menu tree. <a href="class_menu.html#_details">More...</a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_menu_1_1arg.html">Menu::arg</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_menu_1_1command.html">Menu::command</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="menu_8h.html#a7bc4df209e0261ea6ab5303dd8405705">MENU_COMMANDLINE_MAX</a>&nbsp;&nbsp;&nbsp;32</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">maximum input line length <a href="#a7bc4df209e0261ea6ab5303dd8405705"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="menu_8h.html#a78a3dfeac59b72f430d58683a06644fe">MENU_ARGS_MAX</a>&nbsp;&nbsp;&nbsp;4</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">maximum number of arguments <a href="#a78a3dfeac59b72f430d58683a06644fe"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="menu_8h.html#acad44891e2415450762891bd2ca7027d">MENU_COMMAND_MAX</a>&nbsp;&nbsp;&nbsp;14</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">maximum size of a command name <a href="#acad44891e2415450762891bd2ca7027d"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="menu_8h.html#a4f51e7c63dcc5b0801b0a2fcb89eca74">MENU</a>(name, prompt, commands)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="menu_8h.html#a986e3d5cdca86e424132a321f0a1fa35">MENU2</a>(name, prompt, commands, preprompt)</td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Simple commandline menu subsystem. The <a class="el" href="class_menu.html" title="Class defining and handling one menu tree.">Menu</a> class implements a simple CLI that accepts commands typed by the user, and passes the arguments to those commands to a function defined as handing the command. </p>
<p>Commands are defined in an array of <a class="el" href="struct_menu_1_1command.html">Menu::command</a> structures passed to the constructor. Each entry in the array defines one command.</p>
<p>Arguments passed to the handler function are pre-converted to both long and float for convenience. </p>
<p>Definition in file <a class="el" href="menu_8h_source.html">menu.h</a>.</p>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="a4f51e7c63dcc5b0801b0a2fcb89eca74"></a><!-- doxytag: member="menu.h::MENU" ref="a4f51e7c63dcc5b0801b0a2fcb89eca74" args="(name, prompt, commands)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MENU</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">name, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">prompt, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">commands</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> __menu_name__ ##name[] <a class="code" href="_a_p___common_8h.html#a75acaba9e781937468d0911423bc0c35">PROGMEM</a> = prompt; \
<span class="keyword">static</span> <a class="code" href="class_menu.html" title="Class defining and handling one menu tree.">Menu</a> name(__menu_name__ ##name, commands, <span class="keyword">sizeof</span>(commands) / <span class="keyword">sizeof</span>(commands[0]))
</pre></div><p>Macros used to define a menu.</p>
<p>The commands argument should be an arary of <a class="el" href="struct_menu_1_1command.html">Menu::command</a> structures, one per command name. The array does not need to be terminated with any special record.</p>
<p>Use name.run() to run the menu.</p>
<p>The MENU2 macro supports the optional pre-prompt printing function. </p>
<p>Definition at line <a class="el" href="menu_8h_source.html#l00133">133</a> of file <a class="el" href="menu_8h_source.html">menu.h</a>.</p>
</div>
</div>
<a class="anchor" id="a986e3d5cdca86e424132a321f0a1fa35"></a><!-- doxytag: member="menu.h::MENU2" ref="a986e3d5cdca86e424132a321f0a1fa35" args="(name, prompt, commands, preprompt)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MENU2</td>
<td>(</td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">name, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">prompt, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">commands, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">&nbsp;</td>
<td class="paramname">preprompt</td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<b>Value:</b><div class="fragment"><pre class="fragment"><span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">char</span> __menu_name__ ##name[] <a class="code" href="_a_p___common_8h.html#a75acaba9e781937468d0911423bc0c35">PROGMEM</a> = prompt; \
<span class="keyword">static</span> <a class="code" href="class_menu.html" title="Class defining and handling one menu tree.">Menu</a> name(__menu_name__ ##name, commands, <span class="keyword">sizeof</span>(commands) / <span class="keyword">sizeof</span>(commands[0]), preprompt)
</pre></div>
<p>Definition at line <a class="el" href="menu_8h_source.html#l00137">137</a> of file <a class="el" href="menu_8h_source.html">menu.h</a>.</p>
</div>
</div>
<a class="anchor" id="a78a3dfeac59b72f430d58683a06644fe"></a><!-- doxytag: member="menu.h::MENU_ARGS_MAX" ref="a78a3dfeac59b72f430d58683a06644fe" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MENU_ARGS_MAX&nbsp;&nbsp;&nbsp;4</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>maximum number of arguments </p>
<p>Definition at line <a class="el" href="menu_8h_source.html#l00020">20</a> of file <a class="el" href="menu_8h_source.html">menu.h</a>.</p>
</div>
</div>
<a class="anchor" id="acad44891e2415450762891bd2ca7027d"></a><!-- doxytag: member="menu.h::MENU_COMMAND_MAX" ref="acad44891e2415450762891bd2ca7027d" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MENU_COMMAND_MAX&nbsp;&nbsp;&nbsp;14</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>maximum size of a command name </p>
<p>Definition at line <a class="el" href="menu_8h_source.html#l00021">21</a> of file <a class="el" href="menu_8h_source.html">menu.h</a>.</p>
</div>
</div>
<a class="anchor" id="a7bc4df209e0261ea6ab5303dd8405705"></a><!-- doxytag: member="menu.h::MENU_COMMANDLINE_MAX" ref="a7bc4df209e0261ea6ab5303dd8405705" args="" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define MENU_COMMANDLINE_MAX&nbsp;&nbsp;&nbsp;32</td>
</tr>
</table>
</div>
<div class="memdoc">
<p>maximum input line length </p>
<p>Definition at line <a class="el" href="menu_8h_source.html#l00019">19</a> of file <a class="el" href="menu_8h_source.html">menu.h</a>.</p>
</div>
</div>
</div>
<hr class="footer"/><address class="footer"><small>
Generated for ArduPilot Libraries by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>