\r
/* The prototype to which callback functions used to process command line\r
commands must comply. This type will change when commands with parameters \r
-are included. */\r
-typedef const signed char * (*pdCOMMAND_LINE_CALLBACK)( void );\r
+are included. pcWriteBuffer is a buffer into which the output from executing\r
+the command can be written, xWriteBufferLen is the length, in bytes, of the\r
+pcWriteBuffer buffer. */\r
+typedef portBASE_TYPE (*pdCOMMAND_LINE_CALLBACK)( signed char *pcWriteBuffer, size_t xWriteBufferLen );\r
\r
/* The structure that defines command line commands. A command line command\r
should be defined by declaring a const structure of this type. */\r
typedef struct xCOMMAND_LINE_INPUT\r
{\r
- const signed char * const pcCommand; /* The command that causes pxCommandInterpreter to be executed. For example "help". Must be all lower case. */\r
- const signed char * const pcHelpString; /* String that describes how to use the command. Should start with the command itself, and end with "\r\n". For exxample "help: Returns a list of all the commands\r\n". */\r
- pdCOMMAND_LINE_CALLBACK pxCommandInterpreter; /* A pointer to the callback function that will return the output generated by the command. */\r
- const struct xCOMMAND_LINE_INPUT *pxNext; /* A pointer to the next xCommandLinInput structure. This should be NULL when the command is defined. It will get filled in automatically when the command is registered. */\r
+ const signed char * const pcCommand; /* The command that causes pxCommandInterpreter to be executed. For example "help". Must be all lower case. */\r
+ const signed char * const pcHelpString; /* String that describes how to use the command. Should start with the command itself, and end with "\r\n". For example "help: Returns a list of all the commands\r\n". */\r
+ const pdCOMMAND_LINE_CALLBACK pxCommandInterpreter; /* A pointer to the callback function that will return the output generated by the command. */\r
} xCommandLineInput;\r
\r
/*\r
* handled by the command interpreter. Once a command has been registered it\r
* can be executed from the command line.\r
*/\r
-void vCmdIntRegisterCommand( const xCommandLineInput *pxCommandToRegister );\r
+portBASE_TYPE xCmdIntRegisterCommand( const xCommandLineInput * const pxCommandToRegister );\r
\r
/*\r
- * Runns the command interpreter for the command string "pcCommandInput". If\r
- * pcCommandInput is valid (the command has been registered) a string will be \r
- * returned, and pcCmdIntProcessCommand must then be called repeatedly until \r
- * NULL is returned. If pcCommand pcCommandInput is not valid (the command is\r
- * not recognised as a registered command) then an error message will be\r
- * returned - and again pcCmdIntProcessCommand() must be called repeatedly\r
- * until NULL is returned.\r
+ * Runs the command interpreter for the command string "pcCommandInput". Any\r
+ * output generated by running the command will be placed into pcWriteBuffer.\r
+ * xWriteBufferLen must indicate the size, in bytes, of the buffer pointed to\r
+ * by pcWriteBuffer.\r
+ *\r
+ * xCmdIntProcessCommand should be called repeatedly until it returns pdFALSE.\r
*\r
* pcCmdIntProcessCommand is not reentrant. It must not be called from more\r
* than one task - or at least - by more than one task at a time.\r
*/\r
-const signed char *pcCmdIntProcessCommand( const signed char *pcCommandInput );\r
+portBASE_TYPE xCmdIntProcessCommand( const signed char * const pcCommandInput, signed char * pcWriteBuffer, size_t xWriteBufferLen );\r
\r
#endif /* COMMAND_INTERPRETER_H */\r
\r