Adding RTEMS shell commands in BSP and application

Ian Caddy ianc at goanna.iinet.net.au
Fri Sep 18 01:01:09 UTC 2015


Hi,

You did not indicate which version of RTEMS you are using.

We use 4.10 and add our application shell commands programmatically. 
For example:

rtems_shell_add_cmd("findnb", "nameblock", "findnb        # list 
nameblocks", main_findnb);


regards,

Ian Caddy


On 17/09/2015 10:35 PM, sudarshan.rajagopalan wrote:
> Hey guys,
>
> I was working on adding user shell commands in RTEMS. Was able to
> successfully do it. Right now, we want to add few BSP specific shell
> commands and few application specific shell commands. The BSP shell
> commands will be added to the BSP, compiled and built. And also give the
> flexibility to user application to add application specific commands
> later on. One way to do it:
> int bsp1(int argc, char **argv){
> }
> int bsp2(int argc, char **argv){
> }
> rtems_shell_cmd_t BSP1_Command = {
>    "test1",                                  /* name */
>    "test1",                                   /* usage */
>    "user",                                   /* topic */
>    bsp1,                                     /* command */
>    NULL,                                     /* alias */
>    NULL                                      /* next */
> };
> rtems_shell_cmd_t BSP2_Command = {
>    "test2",                                  /* name */
>    "test2",                                   /* usage */
>    "user",                                   /* topic */
>    bsp2,                                    /* command */
>    NULL,                                     /* alias */
>    NULL                                      /* next */
> };
> #define SHELL_USER_COMMANDS \
> &BSP2_Command, \
> &BSP1_Command
> and the same in application code for APP1_Command and APP2_Command. And
> initialize the shell in the application code:
> #define CONFIGURE_SHELL_USER_COMMANDS \
>          SHELL_USER_COMMANDS,          \
>          &APP1_Command,                \
>          &APP2_Command
> #define CONFIGURE_SHELL_COMMANDS_INIT
> ...
> #include <rtems/shellconfig.h>
> Would this be the right way or are there any better ways to do it?
> Please let me know I didn't make myself clear on this.
> Thanks and Regards,
> Sudarshan Rajagopalan
> sudarshan.rajagopalan at vecna.com <mailto:isaac.gutekunst at vecna.com>
>
> Cambridge Research Laboratory
> Vecna Technologies, Inc.
> 36 Cambridge Park Drive
> Cambridge, MA 02140
> http://vecna.com
>
> Better Technology, Better World (TM)
>
>
> _______________________________________________
> devel mailing list
> devel at rtems.org
> http://lists.rtems.org/mailman/listinfo/devel
>

-- 
Ian Caddy
Goanna Technologies Pty Ltd
+61 8 9444 2634




More information about the devel mailing list