Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Interference_Simple StrCommandHandler_Demo
Diff: StrCommandHandler.h
- Revision:
- 1:1d46d90eb7bf
- Parent:
- 0:024213917a9f
- Child:
- 2:a4873d38a32c
--- a/StrCommandHandler.h Thu Oct 31 02:48:35 2019 +0000
+++ b/StrCommandHandler.h Thu Oct 31 18:57:43 2019 +0000
@@ -15,22 +15,36 @@
int const arg_num_ofcommand = 10
);
+ /** Maps strings and functions
+ *
+ * This maps strings(commands) and functions receiving no arguments,
+ * returning int.
+ */
int map(
const char * const arg_command,
int (*arg_pfunc)(void)
);
+ /** Analyzes a command input and executs a function corresponding to it.
+ *
+ * This analyze a string(commands) and executs a corresponding function.
+ * If an error occur, the function returns an error code
+ * Error code:
+ * - Exception of NULL pointer returns 0xFFFFFFFF
+ * - Exception of Null character returna 0xFFFFFFFE
+ * - Exception of Over length returns 0xFFFFFFFD
+ * - Exception of Not registered Command returns 0xFFFFFFFC;
+ */
int exe(
const char* const arg_command
);
+ /** Lists commands registered
+ *
+ * This lists commands registered by users.
+ */
void list();
- template<typename T>
- T analyzeValue(
- const char* const arg_value_str
- );
-
private:
/** Array of commands' name
*