<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Shell - Whereis? in MQX Software Solutions</title>
    <link>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154050#M586</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where do I find information on the shell library used in the demo?&lt;/P&gt;&lt;P&gt;I cannot find the source code, documents etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Nov 2009 06:15:04 GMT</pubDate>
    <dc:creator>CarlFST60L</dc:creator>
    <dc:date>2009-11-13T06:15:04Z</dc:date>
    <item>
      <title>Shell - Whereis?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154050#M586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Where do I find information on the shell library used in the demo?&lt;/P&gt;&lt;P&gt;I cannot find the source code, documents etc&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Nov 2009 06:15:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154050#M586</guid>
      <dc:creator>CarlFST60L</dc:creator>
      <dc:date>2009-11-13T06:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Shell - Whereis?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154051#M587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;you will find shell sources in:&lt;/P&gt;&lt;P&gt;&amp;lt;MQX_INSTALL_DIR&amp;gt;\shell\source\..&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Using shell is quite easy:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;1)Include shell header into your application:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;
#include &amp;lt;shell.h&amp;gt;&lt;/PRE&gt;&lt;UL&gt;&lt;LI&gt;2)Prepare shell command structure:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;
const SHELL_COMMAND_STRUCT Shell_commands[] = {

    { "command_name", command_ptr},   
    { "?",         Shell_command_list },   
    { NULL,        NULL }
};&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;if "command_name" is typed into shell console (IO_STDIN, IO_STDOUT), command_ptr function is called. You can implement your own command function. There are also prepared functions for working with mfs, rtcs, and mqx (sh_tad) - see sh_mfs.h, sh_rtcs.h in"\shell\source\include" directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;3) Start Shell in your program:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;
Shell(Shell_commands, NULL);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example of usage see web_hvac demo, especially files - Shell_Task.c and Command_Lists.c. Do not forgot to enable DEMOCFG_ENABLE_SERIAL_SHELL in HVAC.h.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="message-edit-history"&gt;&lt;SPAN class="edit-author"&gt;Message Edited by PetrL on&lt;/SPAN&gt; &lt;SPAN class="local-date"&gt;2009-11-22&lt;/SPAN&gt; &lt;SPAN class="local-time"&gt;03:01 PM&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:57:28 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154051#M587</guid>
      <dc:creator>PetrL</dc:creator>
      <dc:date>2020-10-29T08:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Shell - Whereis?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154052#M588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to make my own shell commands, but I can not figure out how to build the files I've created.&lt;/P&gt;&lt;P&gt;I wrote sh_myowncmd.c and sh_myowncmd.h, but I always get the errors:&lt;/P&gt;&lt;BLOCKQUOTE&gt;
&lt;P&gt;undefined identifier 'Shell_mycmd'&lt;/P&gt;
&lt;P&gt;the file 'sh_myowncmd.h' cannot be opened&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;&lt;P&gt;I've tried to put the files into the "/Shell" source path but nothing happens&lt;/P&gt;&lt;P&gt;I also tried to edit and rebuild the "Shell source/.project" file, adding my files into it, but didn't work...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where I should put my source files?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are there some document which explain how the mqx libraries work, and how I can add new ones?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've checked the hvac example but i do not understand how it works...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;best regards&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:57:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154052#M588</guid>
      <dc:creator>alfredogualdron</dc:creator>
      <dc:date>2020-10-29T08:57:30Z</dc:date>
    </item>
    <item>
      <title>Re: Shell - Whereis?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154053#M589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When building an MQX application, compiler searches into /lib directory for the MQX include header files and libraries. For your own shell functions, just simply add them into your application project, not to the MQX library project.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you used Freescale CodeWarrior for MCU, I would recommend to create a new application using the CW New Project Wizard for MQX. In a new empty workspace, go to File-&amp;gt;New-&amp;gt;MQX 4.0 Project and then in next steps&lt;/P&gt;&lt;P&gt;-enter the name of your new application&lt;/P&gt;&lt;P&gt;-select the board you will be using&lt;/P&gt;&lt;P&gt;-select New Application&lt;/P&gt;&lt;P&gt;-select Freescale compiler in case of Kinetis (GCC use only with MQX 4.0.1)&lt;/P&gt;&lt;P&gt;-check "Add Shell Support"&lt;/P&gt;&lt;P&gt;-select "Basic Application"&lt;/P&gt;&lt;P&gt;-check "Create shell command structure"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the generated project, see main.c. There is the following structure defined:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13687867759083819" jivemacro_uid="_13687867759083819"&gt;
&lt;P&gt;const SHELL_COMMAND_STRUCT Shell_commands[] = {&lt;/P&gt;
&lt;P&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp; Add your custom shell commands here&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;/* { "command_name",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Your_function }, */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "sh",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_sh },&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "help",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_help },&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "?",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_command_list },&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "exit",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_exit },&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { NULL,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL },&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and you can start adding your commands, for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro _jivemacro_uid_13687867937056956 jive_macro_code" jivemacro_uid="_13687867937056956"&gt;
&lt;P&gt;const SHELL_COMMAND_STRUCT Shell_commands[] = {&lt;/P&gt;
&lt;P&gt;/*&amp;nbsp;&amp;nbsp;&amp;nbsp; Add your custom shell commands here&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/P&gt;
&lt;P&gt;/* { "command_name",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Your_function }, */&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "mycmd", Shell_mycmd }&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "sh",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_sh },&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "help",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_help },&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "?",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_command_list },&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { "exit",&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Shell_exit },&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; { NULL,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NULL },&lt;/P&gt;
&lt;P&gt;};&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then you need to define your "Shell_mycmd" function. In may look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="c++" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13687868380822160" jivemacro_uid="_13687868380822160" modifiedtitle="true"&gt;
&lt;P&gt;int_32 Shell_mycmd (int_32 argc, char_ptr argv[])&lt;/P&gt;
&lt;P&gt;{&lt;/P&gt;
&lt;P&gt;&amp;nbsp; boolean&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print_usage, shorthelp = FALSE;&lt;/P&gt;
&lt;P&gt;print_usage = Shell_check_help_request(argc, argv, &amp;amp;shorthelp );&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;if(!print_usage)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt; {&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; MyFunc0();&lt;/P&gt;
&lt;P&gt; }&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;if (print_usage) &lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt; {&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;if (shorthelp) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;printf("%s\n", argv[0]);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;else &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;{&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;printf("Usage: %s\n", argv[0]);&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt; }&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt; return SHELL_EXIT_SUCCESS;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 9pt; line-height: 12pt;"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;where "MyFunc0" is the user function to be called and implementataon of "print_usage" conditions you can put your own help text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 29 Oct 2020 08:57:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154053#M589</guid>
      <dc:creator>Martin_</dc:creator>
      <dc:date>2020-10-29T08:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Shell - Whereis?</title>
      <link>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154054#M590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you so much...&lt;/P&gt;&lt;P&gt;I tried and it works fine...&lt;/P&gt;&lt;P&gt;&lt;SPAN class="mce_paste_marker"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2013 00:01:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/MQX-Software-Solutions/Shell-Whereis/m-p/154054#M590</guid>
      <dc:creator>alfredogualdron</dc:creator>
      <dc:date>2013-05-22T00:01:03Z</dc:date>
    </item>
  </channel>
</rss>

