Adding RTEMS shell commands in BSP and application
sudarshan.rajagopalan
sudarshan.rajagopalan at vecna.com
Thu Sep 17 14:35:04 UTC 2015
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
Cambridge Research Laboratory
Vecna Technologies, Inc.
36 Cambridge Park Drive
Cambridge, MA 02140
http://vecna.com [1]
Better Technology, Better World (TM)
Links:
------
[1] http://vecna.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20150917/de1671e7/attachment.html>
More information about the devel
mailing list