rusEFI
The most advanced open source ECU
|
Command-line interface commands registry.
Here we have a data structure which holds all the dynamically-registered command line interface action names & callback. This logic is invoked in user context by the console thread - see consoleThreadEntryPoint
TODO: there is too much copy-paste here, this class needs some refactoring :)
see testConsoleLogic()
Definition in file cli_registry.cpp.
Functions | |
void | resetConsoleActions (void) |
static void | doAddAction (const char *token, action_type_e type, Void callback, void *param) |
void | addConsoleActionP (const char *token, VoidPtr callback, void *param) |
void | addConsoleActionSSP (const char *token, VoidCharPtrCharPtrVoidPtr callback, void *param) |
void | addConsoleAction (const char *token, Void callback) |
Register console action without parameters. More... | |
void | addConsoleActionI (const char *token, VoidInt callback) |
Register a console command with one Integer parameter. More... | |
void | addConsoleActionIP (const char *token, VoidIntVoidPtr callback, void *param) |
void | addConsoleActionII (const char *token, VoidIntInt callback) |
Register a console command with two Integer parameters. More... | |
void | addConsoleActionIIP (const char *token, VoidIntIntVoidPtr callback, void *param) |
void | addConsoleActionIF (const char *token, VoidIntFloat callback) |
void | addConsoleActionS (const char *token, VoidCharPtr callback) |
void | addConsoleActionSP (const char *token, VoidCharPtrVoidPtr callback, void *param) |
void | addConsoleActionSS (const char *token, VoidCharPtrCharPtr callback) |
void | addConsoleActionSSS (const char *token, VoidCharPtrCharPtrCharPtr callback) |
void | addConsoleActionSSSSS (const char *token, VoidCharPtrCharPtrCharPtrCharPtrCharPtr callback) |
void | addConsoleActionNANF (const char *token, VoidFloat callback) |
void | addConsoleActionF (const char *token, VoidFloat callback) |
void | addConsoleActionFF (const char *token, VoidFloatFloat callback) |
void | addConsoleActionFFF (const char *token, VoidFloatFloatFloat callback) |
void | addConsoleActionFFFF (const char *token, VoidFloatFloatFloatFloat callback) |
void | addConsoleActionFFP (const char *token, VoidFloatFloatVoidPtr callback, void *param) |
static int | getParameterCount (action_type_e parameterType) |
void | helpCommand (void) |
This function prints out a list of all available commands. More... | |
int | findEndOfToken (const char *line) |
int | tokenLength (const char *msgp) |
char * | unquote (char *line) |
static int | setargs (char *args, char **argv, int max_args) |
int | handleActionWithParameter (TokenCallback *current, char *argv[], int argc) |
void | initConsoleLogic () |
static int | handleConsoleLineInternal (const char *commandLine) |
void | handleConsoleLine (char *line) |
This function takes care of one command line once we have it. More... | |
Variables | |
static int | consoleActionCount = 0 |
static TokenCallback | consoleActions [CONSOLE_MAX_ACTIONS] |
static char | handleBuffer [MAX_CMD_LINE_LENGTH+1] |
void addConsoleAction | ( | const char * | token, |
Void | callback | ||
) |
Register console action without parameters.
Definition at line 89 of file cli_registry.cpp.
Referenced by adcTriggerTurnOnInputPin(), boardInitHardware(), commonInitEngineController(), hip_addconsoleActions(), initBenchTest(), initCan(), initCanGpioMsiobox(), initConsoleLogic(), initEarlyMmcCard(), initElectronicThrottle(), initFlash(), initFlexSensor(), initGps(), initializeConsole(), initKLine(), initMalfunctionIndicator(), initMapDecoder(), initMax3185x(), initPinRepository(), initPrimaryPins(), initSensorCli(), initSent(), initSettings(), initTimePerfActions(), initTriggerCentral(), initWaveAnalyzer(), initWaveChart(), runRusEfi(), startIdleThread(), startLua(), startTunerStudioConnectivity(), ButtonDebounce::stopConfiguration(), and tle9201_add().
void addConsoleActionF | ( | const char * | token, |
VoidFloat | callback | ||
) |
Definition at line 143 of file cli_registry.cpp.
Referenced by hip_addconsoleActions(), initBenchTest(), and initSettings().
void addConsoleActionFF | ( | const char * | token, |
VoidFloatFloat | callback | ||
) |
void addConsoleActionFFF | ( | const char * | token, |
VoidFloatFloatFloat | callback | ||
) |
Definition at line 151 of file cli_registry.cpp.
Referenced by initBenchTest().
void addConsoleActionFFFF | ( | const char * | token, |
VoidFloatFloatFloatFloat | callback | ||
) |
Definition at line 155 of file cli_registry.cpp.
Referenced by initBenchTest().
void addConsoleActionFFP | ( | const char * | token, |
VoidFloatFloatVoidPtr | callback, | ||
void * | param | ||
) |
void addConsoleActionI | ( | const char * | token, |
VoidInt | callback | ||
) |
Register a console command with one Integer parameter.
Definition at line 96 of file cli_registry.cpp.
Referenced by hip_addconsoleActions(), initAdcInputs(), initBenchTest(), initConfigActions(), initializeConsole(), initPotentiometers(), initQcBenchControls(), initSensorCli(), initSettings(), initTimePerfActions(), initTriggerEmulator(), initWaveChart(), setEepromTestConfiguration(), and startTunerStudioConnectivity().
void addConsoleActionIF | ( | const char * | token, |
VoidIntFloat | callback | ||
) |
void addConsoleActionII | ( | const char * | token, |
VoidIntInt | callback | ||
) |
Register a console command with two Integer parameters.
Definition at line 107 of file cli_registry.cpp.
Referenced by initConfigActions(), initKLine(), initPotentiometers(), initQcBenchControls(), startIdleThread(), and startLua().
void addConsoleActionIIP | ( | const char * | token, |
VoidIntIntVoidPtr | callback, | ||
void * | param | ||
) |
void addConsoleActionIP | ( | const char * | token, |
VoidIntVoidPtr | callback, | ||
void * | param | ||
) |
void addConsoleActionNANF | ( | const char * | token, |
VoidFloat | callback | ||
) |
void addConsoleActionP | ( | const char * | token, |
VoidPtr | callback, | ||
void * | param | ||
) |
void addConsoleActionS | ( | const char * | token, |
VoidCharPtr | callback | ||
) |
Definition at line 119 of file cli_registry.cpp.
Referenced by initEarlyMmcCard(), initSettings(), and startLua().
void addConsoleActionSP | ( | const char * | token, |
VoidCharPtrVoidPtr | callback, | ||
void * | param | ||
) |
void addConsoleActionSS | ( | const char * | token, |
VoidCharPtrCharPtr | callback | ||
) |
Definition at line 127 of file cli_registry.cpp.
Referenced by initConfigActions(), initSensorCli(), and initSettings().
void addConsoleActionSSP | ( | const char * | token, |
VoidCharPtrCharPtrVoidPtr | callback, | ||
void * | param | ||
) |
void addConsoleActionSSS | ( | const char * | token, |
VoidCharPtrCharPtrCharPtr | callback | ||
) |
Definition at line 131 of file cli_registry.cpp.
Referenced by initConfigActions(), and startTunerStudioConnectivity().
void addConsoleActionSSSSS | ( | const char * | token, |
VoidCharPtrCharPtrCharPtrCharPtrCharPtr | callback | ||
) |
|
static |
Definition at line 49 of file cli_registry.cpp.
Referenced by addConsoleAction(), addConsoleActionF(), addConsoleActionFF(), addConsoleActionFFF(), addConsoleActionFFFF(), addConsoleActionFFP(), addConsoleActionI(), addConsoleActionIF(), addConsoleActionII(), addConsoleActionIIP(), addConsoleActionIP(), addConsoleActionNANF(), addConsoleActionP(), addConsoleActionS(), addConsoleActionSP(), addConsoleActionSS(), addConsoleActionSSP(), addConsoleActionSSS(), and addConsoleActionSSSSS().
int findEndOfToken | ( | const char * | line | ) |
Looks like this is a quoted token
Matching closing quote not found
Skipping first quote and the symbol after closing quote
Definition at line 205 of file cli_registry.cpp.
|
static |
Definition at line 163 of file cli_registry.cpp.
Referenced by handleConsoleLineInternal(), and helpCommand().
int handleActionWithParameter | ( | TokenCallback * | current, |
char * | argv[], | ||
int | argc | ||
) |
Definition at line 290 of file cli_registry.cpp.
Referenced by handleConsoleLineInternal().
void handleConsoleLine | ( | char * | line | ) |
This function takes care of one command line once we have it.
Definition at line 508 of file cli_registry.cpp.
Referenced by checkStackAndHandleConsoleLine(), and initializeConsole().
|
static |
Definition at line 476 of file cli_registry.cpp.
Referenced by handleConsoleLine().
void helpCommand | ( | void | ) |
This function prints out a list of all available commands.
Definition at line 196 of file cli_registry.cpp.
Referenced by initConsoleLogic().
void initConsoleLogic | ( | ) |
Definition at line 470 of file cli_registry.cpp.
Referenced by initializeConsole().
void resetConsoleActions | ( | void | ) |
Definition at line 45 of file cli_registry.cpp.
|
static |
Definition at line 251 of file cli_registry.cpp.
Referenced by handleConsoleLineInternal().
int tokenLength | ( | const char * | msgp | ) |
Definition at line 228 of file cli_registry.cpp.
char* unquote | ( | char * | line | ) |
Definition at line 240 of file cli_registry.cpp.
|
static |
Definition at line 42 of file cli_registry.cpp.
Referenced by doAddAction(), handleConsoleLineInternal(), helpCommand(), and resetConsoleActions().
|
static |
Definition at line 43 of file cli_registry.cpp.
Referenced by doAddAction(), handleConsoleLineInternal(), and helpCommand().
|
static |
Definition at line 474 of file cli_registry.cpp.
Referenced by handleConsoleLineInternal().