41 #include "contiki-conf.h"
44 #include "loader/symbols.h"
49 #ifdef SHELL_VARS_CONF_RAM_BEGIN
50 #define SHELL_VARS_RAM_BEGIN SHELL_VARS_CONF_RAM_BEGIN
51 #define SHELL_VARS_RAM_END SHELL_VARS_CONF_RAM_END
53 #define SHELL_VARS_RAM_BEGIN 0
54 #define SHELL_VARS_RAM_END (unsigned int)-1
58 PROCESS(shell_vars_process,
"vars");
61 "vars: list all variables in RAM",
64 PROCESS(shell_var_process,
"var");
67 "var <variable>: show content of a variable",
78 for(i = 0; i < symbols_nelts; ++i) {
79 if(symbols[i].name !=
NULL &&
80 (
unsigned int)symbols[i].value >= SHELL_VARS_RAM_BEGIN &&
81 (
unsigned int)symbols[i].value <= SHELL_VARS_RAM_END) {
100 for(i = 0; i < symbols_nelts; ++i) {
101 if(symbols[i].name !=
NULL &&
102 strncmp(symbols[i].name, data, strlen(symbols[i].name)) == 0) {
104 sprintf(numbuf,
" %d", *((
int *)symbols[i].value));
107 for(j = 0; j < 8 * 8; j += 8) {
108 sprintf(numbuf,
"0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x 0x%02x",
109 ((
unsigned char *)symbols[i].value)[j],
110 ((
unsigned char *)symbols[i].value)[j + 1],
111 ((
unsigned char *)symbols[i].value)[j + 2],
112 ((
unsigned char *)symbols[i].value)[j + 3],
113 ((
unsigned char *)symbols[i].value)[j + 4],
114 ((
unsigned char *)symbols[i].value)[j + 5],
115 ((
unsigned char *)symbols[i].value)[j + 6],
116 ((
unsigned char *)symbols[i].value)[j + 7]);
129 shell_vars_init(
void)
void shell_output_str(struct shell_command *c, char *text1, const char *text2)
Output strings from a shell command.
#define PROCESS_EXIT()
Exit the currently running process.
#define PROCESS_BEGIN()
Define the beginning of a process.
#define NULL
The null pointer.
#define PROCESS_THREAD(name, ev, data)
Define the body of a process.
#define PROCESS_END()
Define the end of a process.
void shell_register_command(struct shell_command *c)
Register a command with the shell.
#define PROCESS(name, strname)
Declare a process.
A brief description of what this file is.
#define SHELL_COMMAND(name, command, description, process)
Define a shell command.