Skip to content

Commit

Permalink
added extra status items
Browse files Browse the repository at this point in the history
  • Loading branch information
Erich Styger committed Dec 10, 2022
1 parent 4ecfd72 commit 5c75acf
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Beans/Shell/Shell.bean
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Name>Shell</Name>
<Description>Command Line Shell</Description>
<Author>Erich Styger</Author>
<Version>01.111</Version>
<Version>01.112</Version>
<Icon>Shell</Icon>
<TypesFiles>PE,Shell\Shell</TypesFiles>
<FileVersion>6</FileVersion>
Expand All @@ -17,7 +17,7 @@
<BW_DetailedHelp>yes</BW_DetailedHelp>
<BW_NeedUst>14</BW_NeedUst>
<BeanStatus>PROPOSAL</BeanStatus>
<Copyright> * Copyright (c) 2014-2021, Erich Styger\n * Web: https://mcuoneclipse.com\n * SourceForge: https://sourceforge.net/projects/mcuoneclipse\n * Git: https://github.com/ErichStyger/McuOnEclipse_PEx\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice, this list\n * of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</Copyright>
<Copyright> * Copyright (c) 2014-2022, Erich Styger\n * Web: https://mcuoneclipse.com\n * SourceForge: https://sourceforge.net/projects/mcuoneclipse\n * Git: https://github.com/ErichStyger/McuOnEclipse_PEx\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * - Redistributions of source code must retain the above copyright notice, this list\n * of conditions and the following disclaimer.\n *\n * - Redistributions in binary form must reproduce the above copyright notice, this\n * list of conditions and the following disclaimer in the documentation and/or\n * other materials provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR\n * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</Copyright>
<Category>Software-User Components</Category>
<DemoDriver>no</DemoDriver>
<BeanLevel>High</BeanLevel>
Expand Down
2 changes: 1 addition & 1 deletion Beans/Shell/Shell.uis
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

[USED_FACES]
BeanVersion=01.111
BeanVersion=01.112

InterfacesCount=6

Expand Down
10 changes: 8 additions & 2 deletions Drivers/sw/Shell.drv
Original file line number Diff line number Diff line change
Expand Up @@ -1136,7 +1136,7 @@ bool %'ModuleName'%.%ReadLine(uint8_t *bufStart, uint8_t *buf, size_t bufSize, %
%include Common\ShellPrintStatus.Inc
uint8_t %'ModuleName'%.%PrintStatus(%'ModuleName'_ConstStdIOType *io)
{
unsigned char buf[16];
unsigned char buf[32];

%'ModuleName'%.%SendStatusStr((const unsigned char*)"%'ModuleName'", (const unsigned char*)"Commandline shell status\r\n", io->stdOut);
%'ModuleName'%.%SendStatusStr((const unsigned char*)" Build", (const unsigned char*)__DATE__, io->stdOut);
Expand All @@ -1158,12 +1158,18 @@ uint8_t %'ModuleName'%.%PrintStatus(%'ModuleName'_ConstStdIOType *io)
#if McuShell_CONFIG_MULTI_CMD_ENABLED
%@Utility@'ModuleName'%.strcpy(buf, sizeof(buf), (unsigned char*)"yes: '");
%@Utility@'ModuleName'%.chcat(buf, sizeof(buf), %'ModuleName'%.CONFIG_MULTI_CMD_CHAR);
%@Utility@'ModuleName'%.strcat(buf, sizeof(buf), (unsigned char*)"'\r\n");
%@Utility@'ModuleName'%.strcat(buf, sizeof(buf), (unsigned char*)"', size: ");
%@Utility@'ModuleName'%.strcatNum32u(buf, sizeof(buf), %'ModuleName'%.CONFIG_MULTI_CMD_SIZE);
%@Utility@'ModuleName'%.strcat(buf, sizeof(buf), (unsigned char*)"\r\n");
%'ModuleName'%.%SendStatusStr((const unsigned char*)" multiCmd", buf, io->stdOut);
#else
%'ModuleName'%.%SendStatusStr((const unsigned char*)" multiCmd", (unsigned char*)"no\r\n", io->stdOut);
#endif

%@Utility@'ModuleName'%.Num32uToStr(buf, sizeof(buf), %'ModuleName'%.CONFIG_DEFAULT_SHELL_BUFFER_SIZE);
%@Utility@'ModuleName'%.strcat(buf, sizeof(buf), (unsigned char*)" bytes default size\r\n");
%'ModuleName'%.%SendStatusStr((const unsigned char*)" size", buf, io->stdOut);

return ERR_OK;
}

Expand Down

0 comments on commit 5c75acf

Please sign in to comment.