The CommandProcessor is the interface to install a run-time menu into an embedded system.
Dependents: A_CANAdapter USB2I2C
Diff: CommandProcessor.h
- Revision:
- 12:a8c56bf811b9
- Parent:
- 11:4a3cd3f2183b
- Child:
- 13:e1880be590c4
diff -r 4a3cd3f2183b -r a8c56bf811b9 CommandProcessor.h --- a/CommandProcessor.h Sat Apr 23 14:15:10 2011 +0000 +++ b/CommandProcessor.h Sun May 29 20:40:04 2011 +0000 @@ -5,7 +5,7 @@ /// The CommandProcessor is the interface to install a run-time menu into an embedded system. /// This contains the complete interface to the CommandProcessor. /// -/// @version 1.01 +/// @version 1.03 /// /// @note The CommandProcessor is text-based, because it is intended to interact with a /// user. @@ -56,10 +56,10 @@ /// /// RUNRESULT_T SignOnBanner(char *p) /// { -/// puts("\r\nThis great program was built " __DATE__ " " __TIME__ "."); +/// puts("\r\nThis great program was built " __DATE__ " " __TIME__ "."); /// if (*p == '?') /// puts("\r\nMore details shown here.\r\n"); -/// return runok; +/// return runok; /// } /// RUNRESULT_T Who(char *p) /// { @@ -86,13 +86,25 @@ /// } /// @endcode /// -/// @note Copyright © 2011 by Smartware Computing, all rights reserved. -/// This program may be used by others as long as this copyright notice -/// remains intact. -/// @author David Smart +/// +/// @note Copyright &copr; 2011 by Smartware Computing, all rights reserved. +/// Individuals may use this application for evaluation or non-commercial +/// purposes. Within this restriction, changes may be made to this application +/// as long as this copyright notice is retained. The user shall make +/// clear that their work is a derived work, and not the original. +/// Users of this application and sources accept this application "as is" and +/// shall hold harmless Smartware Computing, for any undesired results while +/// using this application - whether real or imagined. +/// +/// @author David Smart, Smartware Computing /// /// @note /// History +/// v1.03 29 May 2011 +/// \li Slightly improved internal documentation. No external interfaces affected. +/// v1.02 2 May 2011 +/// \li Track the longest command when added, so that the help printout +/// is more nicely formatted. /// v1.01 22 April 2011 /// \li Moving 'About' content into the extended help, /// to free 'About' for application code that uses this library. @@ -203,14 +215,14 @@ /// /// This function has a number of parameters, which make the CommandProcessor quite flexible. /// - /// @param SignOnBanner function, which is used as a signon banner + /// @param SignOnBanner function, which is used as a signon banner /// @param config enables various default menu items, based on the bit values, combine the following: - /// \li CFG_ENABLE_TERMINATE - enables the Exit command - /// \li CFG_ENABLE_SYSTEM - enables system commands Echo, Help, etc. - /// \li CFG_ECHO_ON - initialize with echo on - /// \li CFG_CASE_INSENSITIVE - Command Parser is case insensitive - /// @param maxCmdLen sizes the buffer, and is the maximum number of characters in a single - /// command, including all command arguments + /// \li CFG_ENABLE_TERMINATE - enables the Exit command + /// \li CFG_ENABLE_SYSTEM - enables system commands Echo, Help, etc. + /// \li CFG_ECHO_ON - initialize with echo on + /// \li CFG_CASE_INSENSITIVE - Command Parser is case insensitive + /// @param maxCmdLen sizes the buffer, and is the maximum number of characters in a single + /// command, including all command arguments /// @param kbhit is a user provided function to detect if a character is available for the CommandProcessor, /// and when using standard io, you can typically use kbhit, or _kbhit as your system provides. /// @param getch is a user provided function that provides a single character to the CommandProcessor @@ -218,9 +230,9 @@ /// @param puts is a user provided function that permits the CommandProcessor to output a string /// to which is automatically appended a \\n /// @returns INITRESULT_T to indicate if the init was successful or failed - /// + /// INITRESULT_T (*Init)( - CMD_T *SignOnBanner, + CMD_T *SignOnBanner, CONFIG_T config, int maxCmdLen, int (*kbhit)(void),