Macros | |
#define | ABORT_CHAR CTRL_C |
#define | BKSPACE_CHAR '\b' |
#define | CR '\r' |
#define | CRLF "\r\n" |
#define | CTRL_C 0x03 |
#define | CTRL_Q 0x11 |
#define | ERROR_CRLF "Error"CRLF |
#define | LF '\n' |
#define | OK_CRLF "OK"CRLF |
#define | QUIT_APPEND CTRL_Q |
#define | SHELL_ERRMSG_CONFIGERROR ERROR_CRLF"COULD NOT SET CONFIG"CRLF |
#define | SHELL_ERRMSG_MAINTENANCEMODE ERROR_CRLF"Command unavailable in maintenance mode"CRLF |
#define | SHELL_ERRMSG_MEMALLOC ERROR_CRLF"Memory allocation failed"CRLF |
#define | SHELL_ERRMSG_NOTIMPLEMENTED "NOT IMPLEMENTED"CRLF |
#define | SHELL_MAX_MSGOUT_LEN 128 |
#define | SHELL_MSG_CONFIG_SET "config updated"CRLF |
#define | SHELL_MSG_REBOOT "Reboot to take effect"CRLF |
Typedefs | |
typedef eExecStatus(* | pfShellCmd )(eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
Function pointer typedef that each command should abide to. More... | |
Enumerations | |
enum | eExecStatus { SHELL_EXECSTATUS_OK, SHELL_EXECSTATUS_OK_NO_FREE, SHELL_EXECSTATUS_KO } |
Functions | |
eExecStatus | Shell_exec (signed portCHAR *pcStringCmd, eModId xModId, signed short FsNavId, signed portCHAR **ppcStringReply) |
a command line executor. More... | |
void | v_shell_Print_String_To_Requester_Stream (eModId xModId, const signed portCHAR *pcStringToDisplay) |
Print a string directly to the output stream of a module. More... | |
#define ABORT_CHAR CTRL_C |
Referenced by prvGetCmdLine().
#define BKSPACE_CHAR '\b' |
Referenced by prvGetCmdLine().
#define CR '\r' |
Referenced by prv_append(), and prvGetCmdLine().
#define CRLF "\r\n" |
#define CTRL_C 0x03 |
#define CTRL_Q 0x11 |
#define ERROR_CRLF "Error"CRLF |
#define LF '\n' |
Referenced by prv_append(), and prvGetCmdLine().
#define OK_CRLF "OK"CRLF |
#define QUIT_APPEND CTRL_Q |
Referenced by prv_append().
#define SHELL_ERRMSG_CONFIGERROR ERROR_CRLF"COULD NOT SET CONFIG"CRLF |
#define SHELL_ERRMSG_MAINTENANCEMODE ERROR_CRLF"Command unavailable in maintenance mode"CRLF |
Referenced by e_sensor_cmd_set_config(), e_syscmds_cmd_set_config(), and Shell_exec().
#define SHELL_ERRMSG_MEMALLOC ERROR_CRLF"Memory allocation failed"CRLF |
Referenced by e_actuator_cmd_get_value(), e_actuator_ScheduleCmdSet(), e_cptime_cmd_get_config(), e_ethernet_cmd_get_config(), e_fscmds_shell_cd(), e_fscmds_shell_disk(), e_light_get_config(), e_potentiometer_get_config(), e_sensor_cmd_get_value(), e_smtpclient_cmd_get_config(), e_temperature_get_config(), e_webserver_cmd_get_config(), and v_fscmds_GetStrMsgFromErr().
#define SHELL_ERRMSG_NOTIMPLEMENTED "NOT IMPLEMENTED"CRLF |
#define SHELL_MAX_MSGOUT_LEN 128 |
The max length of a response line.
Referenced by e_fscmds_shell_disk(), e_fscmds_shell_pwd(), e_usbsys_lsusb(), prv_df(), and prv_ls().
#define SHELL_MSG_CONFIG_SET "config updated"CRLF |
Referenced by e_smtpclient_cmd_set_config().
#define SHELL_MSG_REBOOT "Reboot to take effect"CRLF |
Referenced by e_ethernet_cmd_set_config(), and e_webserver_cmd_set_config().
typedef eExecStatus(* pfShellCmd)(eModId xModId, signed short FsNavId, int ac, signed portCHAR *av[], signed portCHAR **ppcStringReply) |
Function pointer typedef that each command should abide to.
xModId | Input. The module that is calling this function. |
FsNavId | Input. The file system navigator id to use if the cmd is a file system command. |
ac | Input. The argument counter. |
av | Input. The argument vector. |
ppcStringReply | Input/Output. The response string. If Input is NULL, no response string will be output. Else a malloc for the response string is performed if the returned status is OK; the caller must then free this string. |
enum eExecStatus |
eExecStatus Shell_exec | ( | signed portCHAR * | pcStringCmd, |
eModId | xModId, | ||
signed short | FsNavId, | ||
signed portCHAR ** | ppcStringReply | ||
) |
a command line executor.
pcStringCmd | Input. The cmd line to execute. NULL-terminated string. Format: cmd [arg[=val]], 2 (arg,val) maximum. WARNING: this string will be modified. |
xModId | Input. The module that is calling this exe function. |
FsNavId | Input. The file system navigator id to use if the cmd is a file system command. |
ppcStringReply | Output. The caller must free this string (by calling vportFree()) only if it is non-NULL and the returned status is OK. |
pcStringCmd | Input. The cmd line to execute. NULL-terminated string. Format: cmd [arg] [arg=val], with 6 (arg,val) maximum. WARNING: this string will be modified. |
xModId | Input. The module that is calling this exe function. |
FsNavId | Input. The file system navigator id to use if the cmd is a file system command. |
ppcStringReply | Output. The caller must free this string (by calling vportFree()) only if it is non-NULL and the returned status is OK. |
References NULL, pdFALSE, st_cmd_registration::pf_exec_cmd, PrevCmdAc, PrevCmdIdx, prvCmdIdentify_Tokenize(), SHELL_CMDSTATUS_NOTFOUND, SHELL_CMDSTATUS_PERMISSIONDENIED, SHELL_ERRMSG_MAINTENANCEMODE, SHELL_EXECSTATUS_KO, SHELL_FS_FIRSTCMDIDX, SHELL_FS_LASTCMDIDX, SHELL_MAX_NBTOKEN, x_supervisor_SemaphoreGive(), and x_supervisor_SemaphoreTake().
Referenced by portTASK_FUNCTION(), and prvweb_ParseCGIRequest().
void v_shell_Print_String_To_Requester_Stream | ( | eModId | xModId, |
const signed portCHAR * | pcStringToDisplay | ||
) |
Print a string directly to the output stream of a module.
xModId | Input. The module associated with the target output stream. |
pcStringToDisplay | Input. The string to print. |
References SYS_MODID_COM1SHELL, SYS_MODID_USB, TRACE_COM2, and vcom1shell_PrintMsg().
Referenced by e_fscmds_shell_fat(), e_fscmds_shell_pwd(), e_usbsys_lsusb(), prv_append(), prv_cat(), prv_df(), prv_e_usbsys_sync_cp_ukey(), and prv_ls().