| |
| |
| <!DOCTYPE html> |
| <html lang="en"> |
| <head> |
| <meta charset="utf-8"> |
| <meta http-equiv="X-UA-Compatible" content="IE=edge"> |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| |
| |
| |
| |
| <title>Shell — Apache Mynewt latest documentation</title> |
| |
| |
| |
| |
| <link rel="shortcut icon" href="../../../_static/mynewt-logo-only-newt32x32.png"/> |
| |
| |
| |
| |
| <link rel="stylesheet" href="../../../_static/css/theme.css" type="text/css" /> |
| |
| |
| <link rel="stylesheet" href="../../../_static/css/sphinx_theme.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../../../_static/css/bootstrap-3.0.3.min.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../../../_static/css/v2.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../../../_static/css/custom.css" type="text/css" /> |
| |
| <link rel="stylesheet" href="../../../_static/css/restructuredtext.css" type="text/css" /> |
| |
| |
| |
| |
| <link rel="stylesheet" href="../../../_static/css/overrides.css" type="text/css" /> |
| <link rel="index" title="Index" |
| href="../../../genindex.html"/> |
| <link rel="search" title="Search" href="../../../search.html"/> |
| <link rel="top" title="Apache Mynewt latest documentation" href="../../../index.html"/> |
| <link rel="up" title="System Modules" href="../system_modules.html"/> |
| <link rel="next" title="Hardware Abstraction Layer" href="../hal/hal.html"/> |
| <link rel="prev" title="Console" href="../console/console.html"/> |
| |
| |
| <script src="../../../_static/js/modernizr.min.js"></script> |
| |
| |
| <script> |
| (function(i, s, o, g, r, a, m) { |
| i["GoogleAnalyticsObject"] = r; |
| (i[r] = |
| i[r] || |
| function() { |
| (i[r].q = i[r].q || []).push(arguments); |
| }), |
| (i[r].l = 1 * new Date()); |
| (a = s.createElement(o)), (m = s.getElementsByTagName(o)[0]); |
| a.async = 1; |
| a.src = g; |
| m.parentNode.insertBefore(a, m); |
| })(window, document, "script", "//www.google-analytics.com/analytics.js", "ga"); |
| |
| ga("create", "UA-72162311-1", "auto"); |
| ga("send", "pageview"); |
| </script> |
| |
| |
| </head> |
| |
| <body class="not-front page-documentation" role="document" > |
| <div id="wrapper"> |
| <div class="container"> |
| <div id="banner" class="row v2-main-banner"> |
| <a class="logo-cell" href="/"> |
| <img class="logo" src="../../../_static/img/logo.png"> |
| </a> |
| <div class="tagline-cell"> |
| <h4 class="tagline">An OS to build, deploy and securely manage billions of devices</h4> |
| </div> |
| <div class="news-cell"> |
| <div class="well"> |
| <h4>Latest News:</h4> <a href="/download">Apache Mynewt 1.12.0, Apache NimBLE 1.7.0 </a> released April 4, 2024) |
| </div> |
| </div> |
| </div> |
| </div> |
| |
| <header> |
| <nav id="navbar" class="navbar navbar-inverse" role="navigation"> |
| <div class="container"> |
| <!-- Collapsed navigation --> |
| <div class="navbar-header"> |
| <!-- Expander button --> |
| <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> |
| <span class="sr-only">Toggle navigation</span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| <span class="icon-bar"></span> |
| </button> |
| |
| </div> |
| |
| <!-- Expanded navigation --> |
| <div class="navbar-collapse collapse"> |
| <!-- Main navigation --> |
| <ul class="nav navbar-nav navbar-right"> |
| <li> |
| <a href="/"><i class="fa fa-home" style="font-size: larger;"></i></a> |
| </li> |
| <li class="important"> |
| <a href="/quick-start/">Quick Start</a> |
| </li> |
| <li> |
| <a href="/about/">About</a> |
| </li> |
| <li> |
| <a href="/talks/">Talks</a> |
| </li> |
| <li class="active"> |
| <a href="/documentation/">Documentation</a> |
| </li> |
| <li> |
| <a href="/download/">Download</a> |
| </li> |
| <li> |
| <a href="/community/">Community</a> |
| </li> |
| <li> |
| <a href="/events/">Events</a> |
| </li> |
| </ul> |
| |
| <!-- Search, Navigation and Repo links --> |
| <ul class="nav navbar-nav navbar-right"> |
| |
| </ul> |
| </div> |
| </div> |
| </nav> |
| </header> |
| <!-- STARTS MAIN CONTENT --> |
| <div id="main-content"> |
| |
| |
| |
| |
| |
| |
| <div id="breadcrumb"> |
| <div class="container"> |
| <a href="/documentation/">Docs</a> / |
| |
| <a href="../../os_user_guide.html">OS User Guide</a> / |
| |
| <a href="../system_modules.html">System Modules</a> / |
| |
| Shell |
| |
| <div class="sourcelink"> |
| <a href="https://github.com/apache/mynewt-core/edit/master/docs/os/modules/shell/shell.rst" class="icon icon-github" |
| rel="nofollow"> Edit on GitHub</a> |
| </div> |
| </div> |
| </div> |
| <!-- STARTS CONTAINER --> |
| <div class="container"> |
| <!-- STARTS .content --> |
| <div id="content" class="row"> |
| |
| <!-- STARTS .container-sidebar --> |
| <div class="container-sidebar col-xs-12 col-sm-3"> |
| <div id="docSidebar" class="sticky-container"> |
| <div role="search" class="sphinx-search"> |
| <form id="rtd-search-form" class="wy-form" action="../../../search.html" method="get"> |
| <input type="text" name="q" placeholder="Search documentation" class="search-documentation" /> |
| <input type="hidden" name="check_keywords" value="yes" /> |
| <input type="hidden" name="area" value="default" /> |
| </form> |
| </div> |
| <!-- Note: only works when deployed --> |
| <select class="form-control" onchange="if (this.value) window.location.href=this.value"> |
| <option value="/latest" selected> |
| Version: latest |
| </option> |
| <option value="/v1_12_0" > |
| Version: 1.12.0 |
| </option> |
| <option value="/v1_11_0" > |
| Version: 1.11.0 |
| </option> |
| <option value="/v1_10_0" > |
| Version: 1.10.0 |
| </option> |
| <option value="/v1_9_0" > |
| Version: 1.9.0 |
| </option> |
| <option value="/v1_8_0" > |
| Version: 1.8.0 |
| </option> |
| <option value="/v1_7_0" > |
| Version: 1.7.0 |
| </option> |
| <option value="/v1_6_0" selected="selected" > |
| Version: 1.6.0 |
| </option> |
| <option value="/v1_5_0" > |
| Version: 1.5.0 |
| </option> |
| <option value="/v1_4_0" > |
| Version: 1.4.0 |
| </option> |
| <option value="/v1_3_0/os/introduction" > |
| Version: 1.3.0 |
| </option> |
| <option value="/v1_2_0/os/introduction" > |
| Version: 1.2.0 |
| </option> |
| <option value="/v1_1_0/os/introduction" > |
| Version: 1.1.0 |
| </option> |
| <option value="/v1_0_0/os/introduction" > |
| Version: 1.0.0 |
| </option> |
| <option value="/v0_9_0/os/introduction" > |
| Version: 0.9.0 |
| </option> |
| </select> |
| <div class="region region-sidebar"> |
| <div class="docs-menu"> |
| |
| |
| |
| <ul class="current"> |
| <li class="toctree-l1"><a class="reference internal" href="../../../index.html">Introduction</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../get_started/index.html">Setup & Get Started</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../concepts.html">Concepts</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../tutorials/tutorials.html">Tutorials</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../external_links.html">Third-party Resources</a></li> |
| <li class="toctree-l1 current"><a class="reference internal" href="../../os_user_guide.html">OS User Guide</a><ul class="current"> |
| <li class="toctree-l2"><a class="reference internal" href="../../core_os/mynewt_os.html">Kernel</a></li> |
| <li class="toctree-l2 current"><a class="reference internal" href="../system_modules.html">System</a><ul class="current"> |
| <li class="toctree-l3"><a class="reference internal" href="../config/config.html">Config</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../logs/logs.html">Logs</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../stats/stats.html">Statistics</a></li> |
| <li class="toctree-l3"><a class="reference internal" href="../console/console.html">Console</a></li> |
| <li class="toctree-l3 current"><a class="current reference internal" href="#">Shell</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l2"><a class="reference internal" href="../hal/hal.html">Hardware Abstraction</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../bootloader/bootloader.html">Secure Bootloader</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../split/split.html">Split Images</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../../core_os/porting/port_os.html">Porting Guide</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../baselibc.html">Baselibc</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../drivers/driver.html">Drivers</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../devmgmt/newtmgr.html">Device Management with Newt Manager</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../mcumgr/mcumgr.html">Device Management with MCUmgr</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../imgmgr/imgmgr.html">Image Manager</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../sysinitconfig/sysinitconfig.html">Compile-Time Configuration</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../fs/fs.html">File System</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../fcb/fcb.html">Flash Circular Buffer</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../sensor_framework/sensor_framework.html">Sensor Framework</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../testutil/testutil.html">Test Utilities</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../json/json.html">JSON</a></li> |
| <li class="toctree-l2"><a class="reference internal" href="../mfg/mfg.html">Manufacturing support</a></li> |
| </ul> |
| </li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../network/index.html">BLE User Guide</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../newt/index.html">Newt Tool Guide</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../newtmgr/index.html">Newt Manager Guide</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../mynewt_faq/index.html">Mynewt FAQ</a></li> |
| <li class="toctree-l1"><a class="reference internal" href="../../../misc/index.html">Appendix</a></li> |
| </ul> |
| |
| |
| |
| </div> |
| </div> |
| </div> |
| <!-- ENDS STICKY CONTAINER --> |
| </div> |
| <!-- ENDS .container-sidebar --> |
| |
| <div class="col-xs-12 col-sm-9"> |
| |
| <div class="alert alert-warning"> |
| <p> |
| Version 1.6.0 is not the most recent version of the |
| Apache Mynewt documentation. Click <a href="/latest">here</a> to |
| read the latest version. |
| </p> |
| </div> |
| |
| |
| |
| <div class=""> |
| <div class="rst-content"> |
| <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article"> |
| <div itemprop="articleBody"> |
| |
| <div class="section" id="shell"> |
| <h1>Shell<a class="headerlink" href="#shell" title="Permalink to this headline">¶</a></h1> |
| <p>The shell runs above the console and provides two functionalities:</p> |
| <ul class="simple"> |
| <li><p>Processes console input. See the <span class="xref std std-doc">Enabling the Console and Shell |
| tutorial</span> for example of the |
| shell.</p></li> |
| <li><p>Implements the <a class="reference internal" href="../../../newtmgr/index.html"><span class="doc">newtmgr</span></a> line |
| protocol over serial transport.</p></li> |
| </ul> |
| <p>The shell uses the OS default event queue for shell events and runs in |
| the context of the main task. An application can, optionally, specify a |
| dedicated event queue for the shell to use.</p> |
| <div class="contents local topic" id="contents"> |
| <ul class="simple"> |
| <li><p><a class="reference internal" href="#description" id="id1">Description</a></p> |
| <ul> |
| <li><p><a class="reference internal" href="#processing-console-input-commands" id="id2">Processing Console Input Commands</a></p></li> |
| <li><p><a class="reference internal" href="#processing-newtmgr-line-protocol-over-serial-transport" id="id3">Processing Newtmgr Line Protocol Over Serial Transport</a></p></li> |
| </ul> |
| </li> |
| <li><p><a class="reference internal" href="#data-structures" id="id4">Data Structures</a></p></li> |
| <li><p><a class="reference internal" href="#api" id="id5">API</a></p></li> |
| </ul> |
| </div> |
| <p>The <code class="docutils literal notranslate"><span class="pre">sys/shell</span></code> package implements the shell. To use the shell you |
| must:</p> |
| <ul class="simple"> |
| <li><p>Include the <code class="docutils literal notranslate"><span class="pre">sys/shell</span></code> package.</p></li> |
| <li><p>Set the <code class="docutils literal notranslate"><span class="pre">SHELL_TASK</span></code> syscfg setting value to 1 to enable the shell.</p></li> |
| </ul> |
| <p><strong>Note:</strong> The functions for the shell API are only compiled and linked |
| with the application when the <code class="docutils literal notranslate"><span class="pre">SHELL_TASK</span></code> setting is enabled. When |
| you develop a package that supports shell commands, we recommend that |
| your pakcage define:</p> |
| <ol class="arabic simple"> |
| <li><p>A syscfg setting that enables shell command processing for your |
| package, with a restriction that when this setting is enabled, the |
| <code class="docutils literal notranslate"><span class="pre">SHELL_TASK</span></code> setting must also be enabled.</p></li> |
| <li><p>A conditional dependency on the <code class="docutils literal notranslate"><span class="pre">sys/shell</span></code> package when the |
| setting defined in 1 above is enabled.</p></li> |
| </ol> |
| <p>Here are example definitions from the <code class="docutils literal notranslate"><span class="pre">syscfg.yml</span></code> and <code class="docutils literal notranslate"><span class="pre">pkg.yml</span></code> |
| files for the <code class="docutils literal notranslate"><span class="pre">sys/log/full</span></code> package. It defines the <code class="docutils literal notranslate"><span class="pre">LOG_CLI</span></code> |
| setting to enable the log command in the shell:</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="gp"># </span>sys/log/full<span class="w"> </span>syscfg.yml |
| <span class="go"> LOG_CLI:</span> |
| <span class="go"> description: 'Expose "log" command in shell.'</span> |
| <span class="go"> value: 0</span> |
| <span class="go"> restrictions:</span> |
| <span class="go"> - SHELL_TASK</span> |
| |
| <span class="gp"># </span>sys/log/full<span class="w"> </span>pkg.yml |
| <span class="go">pkg.deps.LOG_CLI:</span> |
| <span class="go"> - "@apache-mynewt-core/sys/shell"</span> |
| </pre></div> |
| </div> |
| <div class="section" id="description"> |
| <h2><a class="toc-backref" href="#id1">Description</a><a class="headerlink" href="#description" title="Permalink to this headline">¶</a></h2> |
| <div class="section" id="processing-console-input-commands"> |
| <h3><a class="toc-backref" href="#id2">Processing Console Input Commands</a><a class="headerlink" href="#processing-console-input-commands" title="Permalink to this headline">¶</a></h3> |
| <p>The shell’s first job is to direct incoming commands to other |
| subsystems. It parses the incoming character string into tokens and uses |
| the first token to determine the subsystem command handler to call to |
| process the command. When the shell calls the command handler, it passes |
| the other tokens as arguments to the handler.</p> |
| <div class="section" id="registering-command-handlers"> |
| <h4>Registering Command Handlers<a class="headerlink" href="#registering-command-handlers" title="Permalink to this headline">¶</a></h4> |
| <p>A package that implements a shell command must register a command |
| handler to process the command.</p> |
| <p><strong>New in release 1.1</strong>: The shell supports the concept of modules and |
| allows a package to group shell commands under a name space. To run a |
| command in the shell, you enter the module name and the command name. |
| You can set a default module, using the <code class="docutils literal notranslate"><span class="pre">select</span></code> command, so that you |
| only need to enter the command name to run a command from the default |
| module. You can switch the module you designate as the default module.</p> |
| <p>There are two methods to register command handlers in Mynewt 1.1:</p> |
| <ul> |
| <li><p>Method 1 (New in release 1.1): Define and register a set of commands |
| for a module. This method allows grouping shell commands into |
| namespaces. A package calls the <code class="docutils literal notranslate"><span class="pre">shell_register()</span></code> function to |
| define a module and register the command handlers for the module.</p> |
| <p><strong>Note:</strong> The <code class="docutils literal notranslate"><span class="pre">SHELL_MAX_MODULES</span></code> syscfg setting specifies the |
| maximum number of modules that can be registered. You can increase |
| this value if your application and the packages it includes register |
| more than the default value.</p> |
| </li> |
| <li><p>Method 2: Register a command handler without defining a module. A |
| package calls the <code class="docutils literal notranslate"><span class="pre">shell_cmd_register()</span></code> function defined in Mynewt |
| 1.0 to register a command handler. When a shell command is registered |
| using this method, the command is automatically added to the |
| <code class="docutils literal notranslate"><span class="pre">compat</span></code> module. The <code class="docutils literal notranslate"><span class="pre">compat</span></code> module supports backward |
| compatibility for all the shell commands that are registered using |
| the <code class="docutils literal notranslate"><span class="pre">shell_cmd_register()</span></code> function.</p> |
| <p><strong>Notes:</strong></p> |
| <ul class="simple"> |
| <li><p>The <code class="docutils literal notranslate"><span class="pre">SHELL_COMPAT</span></code> syscfg setting must be set to 1 to enable |
| backward compatibility support and the <code class="docutils literal notranslate"><span class="pre">shell_cmd_register()</span></code> |
| function. Since Mynewt packages use method 2 to register shell |
| commands and Mynewt plans to continue this support in future |
| releases, you must keep the default setting value of 1.</p></li> |
| <li><p>The <code class="docutils literal notranslate"><span class="pre">SHELL_MAX_COMPAT_COMMANDS</span></code> syscfg setting specifies the |
| maximum number of command handlers that can be registered using |
| this method. You can increase this value if your application and |
| the packages it includes register more than the default value.</p></li> |
| </ul> |
| </li> |
| </ul> |
| </div> |
| <div class="section" id="enabling-help-information-for-shell-commands"> |
| <h4>Enabling Help Information for Shell Commands<a class="headerlink" href="#enabling-help-information-for-shell-commands" title="Permalink to this headline">¶</a></h4> |
| <p>The shell supports command help. A package that supports command help |
| initializes the <code class="docutils literal notranslate"><span class="pre">struct</span> <span class="pre">shell_cmd</span></code> data structure with help text for |
| the command before it registers the command with the shell. The |
| <code class="docutils literal notranslate"><span class="pre">SHELL_CMD_HELP</span></code> syscfg setting enables or disbles help support for |
| all shell commands. The feature is enabled by default.</p> |
| <p><strong>Note:</strong> A package that implements help for a shell command should only |
| initialize the help data structures within the |
| <code class="docutils literal notranslate"><span class="pre">#if</span> <span class="pre">MYNEWT_VAL(SHELL_CMD_HELP)</span></code> preprocessor directive.</p> |
| </div> |
| <div class="section" id="enabling-the-os-and-prompt-shell-modules"> |
| <h4>Enabling the OS and Prompt Shell Modules<a class="headerlink" href="#enabling-the-os-and-prompt-shell-modules" title="Permalink to this headline">¶</a></h4> |
| <p>The shell implements the <code class="docutils literal notranslate"><span class="pre">os</span></code> and <code class="docutils literal notranslate"><span class="pre">prompt</span></code> modules. These modules |
| support the shell commands to view OS resources.</p> |
| <p>The <code class="docutils literal notranslate"><span class="pre">os</span></code> module implements commands to list task and mempool usage |
| information and to view and change the time of day. The |
| <code class="docutils literal notranslate"><span class="pre">SHELL_OS_MODULE</span></code> syscfg setting enables or disables the module. The |
| module is enabled by default.</p> |
| <p>The <code class="docutils literal notranslate"><span class="pre">prompt</span></code> module implements the <code class="docutils literal notranslate"><span class="pre">ticks</span></code> command that controls |
| whether to print the current os ticks in the prompt. The |
| <code class="docutils literal notranslate"><span class="pre">SHELL_PROMPT_MODULE</span></code> syscfg setting enables or disables this module. |
| The module is disabled by default.</p> |
| </div> |
| <div class="section" id="enabling-command-name-completion"> |
| <h4>Enabling Command Name Completion<a class="headerlink" href="#enabling-command-name-completion" title="Permalink to this headline">¶</a></h4> |
| <p>The shell supports command name completion. The <code class="docutils literal notranslate"><span class="pre">SHELL_COMPLETION</span></code> |
| syscfg setting enables or disables the feature. The feature is enabled |
| by default.</p> |
| </div> |
| </div> |
| <div class="section" id="processing-newtmgr-line-protocol-over-serial-transport"> |
| <h3><a class="toc-backref" href="#id3">Processing Newtmgr Line Protocol Over Serial Transport</a><a class="headerlink" href="#processing-newtmgr-line-protocol-over-serial-transport" title="Permalink to this headline">¶</a></h3> |
| <p>The shell’s second job is to handle packet framing, encoding, and |
| decoding of newtmgr protocol messages that are sent over the console. |
| The Newtmgr serial transport package |
| (<code class="docutils literal notranslate"><span class="pre">mgmt/newtmgr/transport/newtmgr_shell</span></code>) calls the |
| <code class="docutils literal notranslate"><span class="pre">shell_nlip_input_register()</span></code> function to register a handler that the |
| shell calls when it receives newtmgr request messages.</p> |
| <p>The <code class="docutils literal notranslate"><span class="pre">SHELL_NEWTMGR</span></code> syscfg setting specifies whether newtmgr is |
| enabled over shell. The setting is enabled by default.</p> |
| </div> |
| </div> |
| <div class="section" id="data-structures"> |
| <h2><a class="toc-backref" href="#id4">Data Structures</a><a class="headerlink" href="#data-structures" title="Permalink to this headline">¶</a></h2> |
| <p>The <code class="docutils literal notranslate"><span class="pre">struct</span> <span class="pre">shell_cmd</span></code> data structure represents a shell command and |
| is used to register a command.</p> |
| <div class="highlight-console notranslate"><div class="highlight"><pre><span></span><span class="go">struct shell_cmd {</span> |
| <span class="go"> const char *sc_cmd;</span> |
| <span class="go"> shell_cmd_func_t sc_cmd_func;</span> |
| <span class="go"> const struct shell_cmd_help *help;</span> |
| <span class="go">};</span> |
| </pre></div> |
| </div> |
| <table class="docutils align-default"> |
| <colgroup> |
| <col style="width: 43%" /> |
| <col style="width: 57%" /> |
| </colgroup> |
| <thead> |
| <tr class="row-odd"><th class="head"><p>Element</p></th> |
| <th class="head"><p>Description</p></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">sc_cmd</span></code></p></td> |
| <td><p>Character |
| string of the |
| command name.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">sc_cmd_f</span> |
| <span class="pre">unc_t</span></code></p></td> |
| <td><p>Pointer to the |
| command |
| handler that |
| processes the |
| command.</p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">help</span></code></p></td> |
| <td><p>Pointer to the |
| shell_cmd_he |
| lp |
| structure. If |
| the pointer is |
| NULL, help |
| information is |
| not provided.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <p>The <code class="docutils literal notranslate"><span class="pre">sc_cmd_func_t</span></code> is the command handler function type.</p> |
| <div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">typedef</span><span class="w"> </span><span class="kt">int</span><span class="w"> </span><span class="p">(</span><span class="o">*</span><span class="n">shell_cmd_func_t</span><span class="p">)(</span><span class="kt">int</span><span class="w"> </span><span class="n">argc</span><span class="p">,</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">argv</span><span class="p">[]);</span> |
| </pre></div> |
| </div> |
| <p>The <code class="docutils literal notranslate"><span class="pre">argc</span></code> parameter specifies the number of command line arguments |
| and the <code class="docutils literal notranslate"><span class="pre">argv</span></code> parameter is an array of character pointers to the |
| command arguments. The <code class="docutils literal notranslate"><span class="pre">SHELL_CMD_ARGC_MAX</span></code> syscfg setting specifies |
| the maximum number of command line arguments that any shell command can |
| have. This value must be increased if a shell command requires more than |
| <code class="docutils literal notranslate"><span class="pre">SHELL_CMD_ARGC_MAX</span></code> number of command line arguments.</p> |
| <p>The <code class="docutils literal notranslate"><span class="pre">struct</span> <span class="pre">shell_module</span></code> data structure represents a shell module. It |
| is used to register a shell module and the shell commands for the |
| module.</p> |
| <div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">struct</span><span class="w"> </span><span class="nc">shell_module</span><span class="w"> </span><span class="p">{</span> |
| <span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">name</span><span class="p">;</span> |
| <span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">shell_cmd</span><span class="w"> </span><span class="o">*</span><span class="n">commands</span><span class="p">;</span> |
| <span class="p">};</span> |
| </pre></div> |
| </div> |
| <table class="docutils align-default"> |
| <colgroup> |
| <col style="width: 48%" /> |
| <col style="width: 52%" /> |
| </colgroup> |
| <thead> |
| <tr class="row-odd"><th class="head"><p>Eleme nt</p></th> |
| <th class="head"><p>Description</p></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">name</span></code></p></td> |
| <td><p>Character |
| string of the |
| module name.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">commands</span></code></p></td> |
| <td><p>Array of |
| <code class="docutils literal notranslate"><span class="pre">shell_cmd</span></code> |
| structures |
| that specify |
| the commands |
| for the |
| module. The |
| <code class="docutils literal notranslate"><span class="pre">sc_cmd</span></code>, |
| <code class="docutils literal notranslate"><span class="pre">sc_cmd_func</span></code> |
| , and <code class="docutils literal notranslate"><span class="pre">help</span></code> |
| fields in the |
| last entry |
| must be set to |
| NULL to |
| indicate the |
| last entry in |
| the array.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <p><strong>Note</strong>: A command handler registered via the <code class="docutils literal notranslate"><span class="pre">shell_cmd_register()</span></code> |
| function is automatically added to the <code class="docutils literal notranslate"><span class="pre">compat</span></code> module.</p> |
| <p>The <code class="docutils literal notranslate"><span class="pre">struct</span> <span class="pre">shell_param</span></code> and <code class="docutils literal notranslate"><span class="pre">struct</span> <span class="pre">shell_cmd_help</span></code> data |
| structures hold help texts for a shell command.</p> |
| <div class="highlight-c notranslate"><div class="highlight"><pre><span></span>struct shell_param { |
| const char *param_name; |
| const char *help; |
| };` |
| </pre></div> |
| </div> |
| <table class="docutils align-default"> |
| <colgroup> |
| <col style="width: 24%" /> |
| <col style="width: 76%" /> |
| </colgroup> |
| <thead> |
| <tr class="row-odd"><th class="head"><p>Element</p></th> |
| <th class="head"><p>Description</p></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">param_name</span></code></p></td> |
| <td><p>Character string of the command parameter name.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">help</span></code></p></td> |
| <td><p>Character string of the help text for the parameter.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| <div class="highlight-c notranslate"><div class="highlight"><pre><span></span><span class="k">struct</span><span class="w"> </span><span class="nc">shell_cmd_help</span><span class="w"> </span><span class="p">{</span> |
| <span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">summary</span><span class="p">;</span> |
| <span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="kt">char</span><span class="w"> </span><span class="o">*</span><span class="n">usage</span><span class="p">;</span> |
| <span class="w"> </span><span class="k">const</span><span class="w"> </span><span class="k">struct</span><span class="w"> </span><span class="nc">shell_param</span><span class="w"> </span><span class="o">*</span><span class="n">params</span><span class="p">;</span> |
| <span class="p">};</span> |
| </pre></div> |
| </div> |
| <table class="docutils align-default"> |
| <colgroup> |
| <col style="width: 43%" /> |
| <col style="width: 57%" /> |
| </colgroup> |
| <thead> |
| <tr class="row-odd"><th class="head"><p>Element</p></th> |
| <th class="head"><p>Description</p></th> |
| </tr> |
| </thead> |
| <tbody> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">summary</span></code></p></td> |
| <td><p>Character |
| string of a |
| short |
| description of |
| the command.</p></td> |
| </tr> |
| <tr class="row-odd"><td><p><code class="docutils literal notranslate"><span class="pre">usage</span></code></p></td> |
| <td><p>Character |
| string of a |
| usage |
| description |
| for the |
| command.</p></td> |
| </tr> |
| <tr class="row-even"><td><p><code class="docutils literal notranslate"><span class="pre">params</span></code></p></td> |
| <td><p>Array of |
| <code class="docutils literal notranslate"><span class="pre">shell_param`</span> |
| <span class="pre">`</span> |
| <span class="pre">structures</span> |
| <span class="pre">that</span> <span class="pre">describe</span> |
| <span class="pre">each</span> <span class="pre">parameter</span> |
| <span class="pre">for</span> <span class="pre">the</span> |
| <span class="pre">command.</span> <span class="pre">The</span> |
| <span class="pre">last</span> |
| <span class="pre">``struct</span> <span class="pre">shell</span> |
| <span class="pre">_param</span></code> |
| in the array |
| must have the |
| <code class="docutils literal notranslate"><span class="pre">param_name</span></code> |
| and <code class="docutils literal notranslate"><span class="pre">help</span></code> |
| fields set to |
| NULL to |
| indicate the |
| last entry in |
| the array.</p></td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <div class="section" id="api"> |
| <h2><a class="toc-backref" href="#id5">API</a><a class="headerlink" href="#api" title="Permalink to this headline">¶</a></h2> |
| <div class="breathe-sectiondef docutils container"> |
| <p class="breathe-sectiondef-title rubric" id="breathe-section-title-typedefs">Typedefs</p> |
| <dl class="c type"> |
| <dt id="c.shell_cmd_func_t"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1a4f24340986f054070fb1a7ae8970a76c"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <span class="pre">(</span><span class="pre">*</span><code class="sig-name descname"><span class="pre">shell_cmd_func_t</span></code><span class="pre">)</span><span class="sig-paren">(</span><span class="pre">int</span> <span class="pre">argc</span>, <span class="pre">char</span> <span class="pre">*</span><span class="pre">argv</span><span class="pre">[</span><span class="pre">]</span><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_cmd_func_t" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><p>Callback called when command is entered. </p> |
| <p><dl class="simple"> |
| <dt><strong>Return</strong></dt><dd><p>0 in case of success or negative value in case of error. </p> |
| </dd> |
| <dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">argc</span></code>: Number of parameters passed. </p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">argv</span></code>: Array of option strings. First option is always command name.</p></li> |
| </ul> |
| </dd> |
| </dl> |
| </p> |
| </dd></dl> |
| |
| <dl class="c type"> |
| <dt id="c.shell_nlip_input_func_t"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1a94929e90137ec9e4c869f82bd939ee7b"></span><em class="property"><span class="pre">typedef</span> </em><span class="pre">int</span> <span class="pre">(</span><span class="pre">*</span><code class="sig-name descname"><span class="pre">shell_nlip_input_func_t</span></code><span class="pre">)</span><span class="sig-paren">(</span><em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a><span class="pre">*</span>, <span class="pre">void</span> <span class="pre">*</span><span class="pre">arg</span><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_nlip_input_func_t" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| </div> |
| <div class="breathe-sectiondef docutils container"> |
| <p class="breathe-sectiondef-title rubric" id="breathe-section-title-functions">Functions</p> |
| <dl class="c function"> |
| <dt id="c.shell_register"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1a791de4f5dc04279716fa8fc78d6735d1"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">shell_register</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <span class="pre">char</span> <span class="pre">*</span><em><span class="pre">shell_name</span></em>, <em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="#c.shell_cmd" title="shell_cmd"><span class="pre">shell_cmd</span></a> <span class="pre">*</span><em><span class="pre">shell_commands</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_register" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><p>Register a <a class="reference internal" href="#structshell__module"><span class="std std-ref">shell_module</span></a> object. </p> |
| <p><dl class="simple"> |
| <dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">shell_name</span></code>: Module name to be entered in shell console.</p></li> |
| <li><p><code class="docutils literal notranslate"><span class="pre">shell_commands</span></code>: Array of commands to register. The array should be terminated with an empty element. </p></li> |
| </ul> |
| </dd> |
| </dl> |
| </p> |
| </dd></dl> |
| |
| <dl class="c function"> |
| <dt id="c.shell_register_app_cmd_handler"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1ac2268816b7823f576e087a1153b19ba0"></span><span class="pre">void</span> <code class="sig-name descname"><span class="pre">shell_register_app_cmd_handler</span></code><span class="sig-paren">(</span><a class="reference internal" href="#c.shell_cmd_func_t" title="shell_cmd_func_t"><span class="pre">shell_cmd_func_t</span></a> <em><span class="pre">handler</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_register_app_cmd_handler" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><p>Optionally register an app default cmd handler. </p> |
| <p><dl class="simple"> |
| <dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">handler</span></code>: To be called if no cmd found in cmds registered with shell_init. </p></li> |
| </ul> |
| </dd> |
| </dl> |
| </p> |
| </dd></dl> |
| |
| <dl class="c function"> |
| <dt id="c.shell_register_prompt_handler"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1a53fddbdf65b925caf1583634432e2ba4"></span><span class="pre">void</span> <code class="sig-name descname"><span class="pre">shell_register_prompt_handler</span></code><span class="sig-paren">(</span><span class="pre">shell_prompt_function_t</span> <em><span class="pre">handler</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_register_prompt_handler" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><p>Optionally register a custom prompt callback. </p> |
| <p><dl class="simple"> |
| <dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">handler</span></code>: To be called to get the current prompt. </p></li> |
| </ul> |
| </dd> |
| </dl> |
| </p> |
| </dd></dl> |
| |
| <dl class="c function"> |
| <dt id="c.shell_register_default_module"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1a81af9956dbab0b20bb1ff20049129f92"></span><span class="pre">void</span> <code class="sig-name descname"><span class="pre">shell_register_default_module</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <span class="pre">char</span> <span class="pre">*</span><em><span class="pre">name</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_register_default_module" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><p>Optionally register a default module, to avoid typing it in shell console. </p> |
| <p><dl class="simple"> |
| <dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">name</span></code>: Module name. </p></li> |
| </ul> |
| </dd> |
| </dl> |
| </p> |
| </dd></dl> |
| |
| <dl class="c function"> |
| <dt id="c.shell_evq_set"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1ab1ea094e0aa9434d0be223d9454ac160"></span><span class="pre">void</span> <code class="sig-name descname"><span class="pre">shell_evq_set</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../core_os/event_queue/event_queue.html#c.os_eventq" title="os_eventq"><span class="pre">os_eventq</span></a> <span class="pre">*</span><em><span class="pre">evq</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_evq_set" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><p>Optionally set event queue to process shell command events. </p> |
| <p><dl class="simple"> |
| <dt><strong>Parameters</strong></dt><dd><ul class="breatheparameterlist simple"> |
| <li><p><code class="docutils literal notranslate"><span class="pre">evq</span></code>: Event queue to be used in shell </p></li> |
| </ul> |
| </dd> |
| </dl> |
| </p> |
| </dd></dl> |
| |
| <dl class="c function"> |
| <dt id="c.shell_nlip_input_register"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1a78c58df45f8d895fc64f6bf05c7a7e50"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">shell_nlip_input_register</span></code><span class="sig-paren">(</span><a class="reference internal" href="#c.shell_nlip_input_func_t" title="shell_nlip_input_func_t"><span class="pre">shell_nlip_input_func_t</span></a> <em><span class="pre">nf</span></em>, <span class="pre">void</span> <span class="pre">*</span><em><span class="pre">arg</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_nlip_input_register" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| <dl class="c function"> |
| <dt id="c.shell_nlip_output"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1a158b3c11a9447e9ad5e801a522ff5de8"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">shell_nlip_output</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="../../core_os/mbuf/mbuf.html#c.os_mbuf" title="os_mbuf"><span class="pre">os_mbuf</span></a> <span class="pre">*</span><em><span class="pre">m</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_nlip_output" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| <dl class="c function"> |
| <dt id="c.shell_cmd_register"> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1ac2c9f78575f01af4af301ba0d641dfd4"></span><span class="pre">int</span> <code class="sig-name descname"><span class="pre">shell_cmd_register</span></code><span class="sig-paren">(</span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="#c.shell_cmd" title="shell_cmd"><span class="pre">shell_cmd</span></a> <span class="pre">*</span><em><span class="pre">sc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#c.shell_cmd_register" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| </div> |
| <div class="breathe-sectiondef docutils container"> |
| <p class="breathe-sectiondef-title rubric" id="breathe-section-title-variables">Variables</p> |
| <dl class="c var"> |
| <dt> |
| <span class="target" id="mynewt-core_2sys_2shell_2include_2shell_2shell_8h_1a5df8365ae30d6eb7a56db5b7b85c2e4f"></span><code class="sig-name descname"><span class="pre">const</span> <span class="pre">typedef</span> <span class="pre">char</span> <span class="pre">*(*</span> <span class="pre">shell_prompt_function_t</span> <span class="pre">)(void)</span></code></dt> |
| <dd><p>Callback to get the current prompt. </p> |
| <p><dl class="simple"> |
| <dt><strong>Return</strong></dt><dd><p>Current prompt string. </p> |
| </dd> |
| </dl> |
| </p> |
| </dd></dl> |
| |
| </div> |
| <dl class="c struct"> |
| <dt id="c.shell_param"> |
| <span class="target" id="structshell__param"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">shell_param</span></code><a class="headerlink" href="#c.shell_param" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><em>#include <shell.h></em><div class="breathe-sectiondef docutils container"> |
| <p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p> |
| <dl class="c var"> |
| <dt id="c.shell_param.param_name"> |
| <span class="target" id="structshell__param_1aa06386de03ecebd3c007f0361ce41f40"></span><em class="property"><span class="pre">const</span></em> <span class="pre">char</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">param_name</span></code><a class="headerlink" href="#c.shell_param.param_name" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| <dl class="c var"> |
| <dt id="c.shell_param.help"> |
| <span class="target" id="structshell__param_1a1f135a7d80d2301df2ca34968781f3ed"></span><em class="property"><span class="pre">const</span></em> <span class="pre">char</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">help</span></code><a class="headerlink" href="#c.shell_param.help" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| </div> |
| </dd></dl> |
| |
| <dl class="c struct"> |
| <dt id="c.shell_cmd_help"> |
| <span class="target" id="structshell__cmd__help"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">shell_cmd_help</span></code><a class="headerlink" href="#c.shell_cmd_help" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><em>#include <shell.h></em><div class="breathe-sectiondef docutils container"> |
| <p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p> |
| <dl class="c var"> |
| <dt id="c.shell_cmd_help.summary"> |
| <span class="target" id="structshell__cmd__help_1ab3202a140cfeedc0e02d4b981cb47293"></span><em class="property"><span class="pre">const</span></em> <span class="pre">char</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">summary</span></code><a class="headerlink" href="#c.shell_cmd_help.summary" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| <dl class="c var"> |
| <dt id="c.shell_cmd_help.usage"> |
| <span class="target" id="structshell__cmd__help_1a3735f4afeeea3d968d9e8fc74e0aa68f"></span><em class="property"><span class="pre">const</span></em> <span class="pre">char</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">usage</span></code><a class="headerlink" href="#c.shell_cmd_help.usage" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| <dl class="c var"> |
| <dt id="c.shell_cmd_help.params"> |
| <span class="target" id="structshell__cmd__help_1a0d80619b39be6e34016c00fffc3d67a0"></span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="#c.shell_param" title="shell_param"><span class="pre">shell_param</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">params</span></code><a class="headerlink" href="#c.shell_cmd_help.params" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| </div> |
| </dd></dl> |
| |
| <dl class="c struct"> |
| <dt id="c.shell_cmd"> |
| <span class="target" id="structshell__cmd"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">shell_cmd</span></code><a class="headerlink" href="#c.shell_cmd" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><em>#include <shell.h></em><div class="breathe-sectiondef docutils container"> |
| <p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p> |
| <dl class="c var"> |
| <dt id="c.shell_cmd.sc_cmd"> |
| <span class="target" id="structshell__cmd_1a51aba60c653e8927f30d5ecf75ab5283"></span><em class="property"><span class="pre">const</span></em> <span class="pre">char</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">sc_cmd</span></code><a class="headerlink" href="#c.shell_cmd.sc_cmd" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| <dl class="c var"> |
| <dt id="c.shell_cmd.sc_cmd_func"> |
| <span class="target" id="structshell__cmd_1a7d208ca94288febfbbb8205e19190e7e"></span><a class="reference internal" href="#c.shell_cmd_func_t" title="shell_cmd_func_t"><span class="pre">shell_cmd_func_t</span></a> <code class="sig-name descname"><span class="pre">sc_cmd_func</span></code><a class="headerlink" href="#c.shell_cmd.sc_cmd_func" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| <dl class="c var"> |
| <dt id="c.shell_cmd.help"> |
| <span class="target" id="structshell__cmd_1a62585f470359ce8a405ed3e6c83a5c99"></span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="#c.shell_cmd_help" title="shell_cmd_help"><span class="pre">shell_cmd_help</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">help</span></code><a class="headerlink" href="#c.shell_cmd.help" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| </div> |
| </dd></dl> |
| |
| <dl class="c struct"> |
| <dt id="c.shell_module"> |
| <span class="target" id="structshell__module"></span><em class="property"><span class="pre">struct</span> </em><code class="sig-name descname"><span class="pre">shell_module</span></code><a class="headerlink" href="#c.shell_module" title="Permalink to this definition">¶</a><br /></dt> |
| <dd><em>#include <shell.h></em><div class="breathe-sectiondef docutils container"> |
| <p class="breathe-sectiondef-title rubric" id="breathe-section-title-public-members">Public Members</p> |
| <dl class="c var"> |
| <dt id="c.shell_module.name"> |
| <span class="target" id="structshell__module_1ac0af6f8292d965a87df0b99458308e76"></span><em class="property"><span class="pre">const</span></em> <span class="pre">char</span> <span class="pre">*</span><code class="sig-name descname"><span class="pre">name</span></code><a class="headerlink" href="#c.shell_module.name" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| <dl class="c var"> |
| <dt id="c.shell_module.commands"> |
| <span class="target" id="structshell__module_1a7fa73d8f9389aca416b04170de171695"></span><em class="property"><span class="pre">const</span></em> <em class="property"><span class="pre">struct</span></em> <a class="reference internal" href="#c.shell_cmd" title="shell_cmd"><span class="pre">shell_cmd</span></a> <span class="pre">*</span><code class="sig-name descname"><span class="pre">commands</span></code><a class="headerlink" href="#c.shell_module.commands" title="Permalink to this definition">¶</a><br /></dt> |
| <dd></dd></dl> |
| |
| </div> |
| </dd></dl> |
| |
| </div> |
| </div> |
| |
| |
| </div> |
| </div> |
| |
| <div class="rst-footer-buttons row" role="navigation" aria-label="footer navigation"> |
| |
| <a href="../hal/hal.html" class="btn btn-neutral float-right" title="Hardware Abstraction Layer" accesskey="n">Next: Hardware Abstraction Layer <span class="fa fa-arrow-circle-right"></span></a> |
| |
| |
| <a href="../console/console.html" class="btn btn-neutral" title="Console" accesskey="p"><span class="fa fa-arrow-circle-left"></span> Previous: Console</a> |
| |
| </div> |
| |
| </div> |
| </div> |
| </div> |
| <!-- ENDS CONTENT SECTION --> |
| </div> |
| <!-- ENDS .content --> |
| </div> |
| </div> |
| <footer> |
| <div class="container"> |
| <div class="row"> |
| <div class="col-xs-12"> |
| |
| <p class="copyright">Apache Mynewt is available under Apache License, version 2.0.</p> |
| |
| </div> |
| <div class="col-xs-12"> |
| <div class="logos"> |
| <img src="../../../_static/img/asf_logo_wide_small.png" alt="Apache" title="Apache"> |
| <small class="footnote"> |
| Apache Mynewt, Mynewt, Apache, the Apache feather logo, and the Apache Mynewt project logo are either |
| registered trademarks or trademarks of the Apache Software Foundation in the United States and other countries. |
| </small> |
| <a href=""> |
| <img src="../../../_static/img/add_to_slack.png" alt="Slack Icon" title="Join our Slack Community" /> |
| </a> |
| </div> |
| </div> |
| </div> |
| </div> |
| </footer> |
| </div> |
| <!-- ENDS #wrapper --> |
| |
| |
| |
| <script type="text/javascript"> |
| var DOCUMENTATION_OPTIONS = { |
| URL_ROOT:'../../../', |
| VERSION:'latest', |
| COLLAPSE_INDEX:false, |
| FILE_SUFFIX:'.html', |
| HAS_SOURCE: true, |
| SOURCELINK_SUFFIX: '.txt', |
| LINK_SUFFIX: '.html' |
| }; |
| </script> |
| <script type="text/javascript" src="../../../_static/jquery.js"></script> |
| <script type="text/javascript" src="../../../_static/underscore.js"></script> |
| <script type="text/javascript" src="../../../_static/doctools.js"></script> |
| <script type="text/javascript" src="../../../_static/js/bootstrap-3.0.3.min.js"></script> |
| <script type="text/javascript" src="../../../_static/js/affix.js"></script> |
| <script type="text/javascript" src="../../../_static/js/main.js"></script> |
| |
| |
| |
| </body> |
| </html> |