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
StrCommandHandler Class Reference
Maps strings and functions. More...
#include <StrCommandHandler.h>
Public Member Functions | |
| void | map (const char *const arg_command, void *(*arg_pfunc)(const char *const)) |
| Maps strings and functions. | |
| void * | exe (const char *const arg_command) |
| Analyzes a command input and executs a function corresponding to it. | |
| void | list () |
| Lists commands registered. | |
Static Public Attributes | |
| static char const *const | ARROW_DOWN = "\x1b\x5b\x42" |
| ascii code series arrow-up symbol 0x1b 0x5b, 0x41 | |
| static char const *const | ARROW_RIGHT = "\x1b\x5b\x43" |
| ascii code series arrow-up symbol 0x1b 0x5b, 0x42 | |
| static char const *const | ARROW_LEFT = "\x1b\x5b\x44" |
| ascii code series arrow-up symbol 0x1b 0x5b, 0x43 | |
Detailed Description
Maps strings and functions.
This class can map strings(commands) and functions receiving no arguments returning int.
Definition at line 11 of file StrCommandHandler.h.
Member Function Documentation
| void * exe | ( | const char *const | arg_command ) |
Analyzes a command input and executs a function corresponding to it.
This analyzes 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;
Definition at line 55 of file StrCommandHandler.cpp.
| void list | ( | ) |
Lists commands registered.
This lists commands registered by users.
Definition at line 87 of file StrCommandHandler.cpp.
| void map | ( | const char *const | arg_command, |
| void *(*)(const char *const) | arg_pfunc | ||
| ) |
Maps strings and functions.
This maps strings(commands) and functions receiving own command, returning something of pointer.
Definition at line 17 of file StrCommandHandler.cpp.
Field Documentation
char const *const ARROW_DOWN = "\x1b\x5b\x42" [static] |
ascii code series arrow-up symbol 0x1b 0x5b, 0x41
Definition at line 50 of file StrCommandHandler.h.
char const *const ARROW_LEFT = "\x1b\x5b\x44" [static] |
ascii code series arrow-up symbol 0x1b 0x5b, 0x43
Definition at line 52 of file StrCommandHandler.h.
char const *const ARROW_RIGHT = "\x1b\x5b\x43" [static] |
ascii code series arrow-up symbol 0x1b 0x5b, 0x42
Definition at line 51 of file StrCommandHandler.h.
Generated on Tue Jul 12 2022 23:49:56 by
1.7.2