NULL /* The next pointer is initialised to NULL, as there are no other registered commands yet. */\r
};\r
\r
+/* A buffer into which command outputs can be written is declared here, rather\r
+than in the command console implementation, to allow multiple command consoles\r
+to share the same buffer. For example, an application may allow access to the\r
+command interpreter by UART and by Ethernet. Sharing a buffer is done purely\r
+to save RAM. Note, however, that the command console itself is not re-entrant,\r
+so only one command interpreter interface can be used at any one time. For that\r
+reason, no attempt at providing mutual exclusion to the cOutputBuffer array is\r
+attempted. */\r
+static signed char cOutputBuffer[ configCOMMAND_INT_MAX_OUTPUT_SIZE ];\r
+\r
/*-----------------------------------------------------------*/\r
\r
portBASE_TYPE xCmdIntRegisterCommand( const xCommandLineInput * const pxCommandToRegister )\r
/* Set the end of list marker to the new list item. */\r
pxLastCommandInList = pxNewListItem;\r
}\r
+ taskEXIT_CRITICAL();\r
\r
xReturn = pdPASS;\r
}\r
}\r
/*-----------------------------------------------------------*/\r
\r
+signed char *pcCmdIntGetOutputBuffer( void )\r
+{\r
+ return cOutputBuffer;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
+unsigned portBASE_TYPE uxCmdIntGetOutputBufferSizeBytes( void )\r
+{\r
+ return configCOMMAND_INT_MAX_OUTPUT_SIZE;\r
+}\r
+/*-----------------------------------------------------------*/\r
+\r
static portBASE_TYPE prvHelpCommand( signed char *pcWriteBuffer, size_t xWriteBufferLen )\r
{\r
static const xCommandLineInputListItem * pxCommand = NULL;\r
\r
return xReturn;\r
}\r
+\r
*/\r
portBASE_TYPE xCmdIntProcessCommand( const signed char * const pcCommandInput, signed char * pcWriteBuffer, size_t xWriteBufferLen );\r
\r
+/*-----------------------------------------------------------*/\r
+\r
+/*\r
+ * A buffer into which command outputs can be written is declared in the\r
+ * main command interpreter, rather than in the command console implementation,\r
+ * to allow application that provide access to the command console via multiple\r
+ * interfaces to share a buffer, and therefore save RAM. Note, however, that\r
+ * the command interpreter itself is not re-entrant, so only one command\r
+ * console interface can be used at any one time. For that reason, no attempt\r
+ * is made to provide any mutual exclusion mechanism on the output buffer.\r
+ *\r
+ * pcCmdIntGetOutputBuffer() returns the address of the output buffer.\r
+ *\r
+ * uxCmdIntGetOutputBufferSizeBytes() returns the size, in bytes, of the output\r
+ * buffer returned by pcCmdIntGetOutputBuffer();\r
+ */\r
+signed char *pcCmdIntGetOutputBuffer( void );\r
+unsigned portBASE_TYPE uxCmdIntGetOutputBufferSizeBytes( void );\r
+\r
#endif /* COMMAND_INTERPRETER_H */\r
\r
\r