rusefi-1/firmware/util/cli_registry.h

86 lines
2.3 KiB
C
Raw Normal View History

2014-08-29 07:52:33 -07:00
/**
* @file cli_registry.h
* @brief Command-line interface commands registry
*
* @date Nov 15, 2012
2015-01-12 15:04:10 -08:00
* @author Andrey Belomutskiy, (c) 2012-2015
2014-08-29 07:52:33 -07:00
*/
#ifndef RFICONSOLE_LOGIC_H_
#define RFICONSOLE_LOGIC_H_
2014-12-29 18:04:24 -08:00
#include "efifeatures.h"
2015-02-08 12:07:01 -08:00
#include "datalogging.h"
2015-01-14 06:05:59 -08:00
#include "rusefi_types.h"
2014-08-29 07:52:33 -07:00
typedef enum {
NO_PARAMETER,
2014-09-17 13:03:04 -07:00
NO_PARAMETER_P,
2014-08-29 07:52:33 -07:00
ONE_PARAMETER,
2014-10-21 13:03:04 -07:00
ONE_PARAMETER_P,
2014-08-29 07:52:33 -07:00
FLOAT_PARAMETER,
2014-10-21 13:03:04 -07:00
FLOAT_PARAMETER_P,
2014-08-29 07:52:33 -07:00
STRING_PARAMETER,
2014-11-18 12:03:13 -08:00
STRING_PARAMETER_P,
2014-08-29 07:52:33 -07:00
STRING2_PARAMETER,
2014-09-20 12:03:00 -07:00
STRING2_PARAMETER_P,
2014-08-29 07:52:33 -07:00
STRING3_PARAMETER,
STRING5_PARAMETER,
TWO_INTS_PARAMETER,
2014-09-20 12:03:00 -07:00
TWO_INTS_PARAMETER_P,
FLOAT_FLOAT_PARAMETER,
FLOAT_FLOAT_PARAMETER_P,
2014-09-15 09:03:05 -07:00
} action_type_e;
2014-08-29 07:52:33 -07:00
typedef struct {
const char *token;
2014-09-15 09:03:05 -07:00
action_type_e parameterType;
2014-08-29 07:52:33 -07:00
void (*callback)(void);
2014-09-17 13:03:04 -07:00
void *param;
2014-08-29 07:52:33 -07:00
} TokenCallback;
2015-02-08 12:07:01 -08:00
int tokenLength(const char *msgp);
2014-09-20 12:03:00 -07:00
2015-02-08 12:07:01 -08:00
#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */
2014-08-29 07:52:33 -07:00
char *validateSecureLine(char *line);
void resetConsoleActions(void);
void helpCommand(void);
2015-01-15 13:03:51 -08:00
void initConsoleLogic(Logging *sharedLogger);
2014-08-29 07:52:33 -07:00
void handleConsoleLine(char *line);
2014-10-11 06:02:57 -07:00
int findEndOfToken(const char *line);
2014-10-12 15:02:54 -07:00
char *unquote(char *line);
2014-10-11 06:02:57 -07:00
2014-08-29 07:52:33 -07:00
void addConsoleAction(const char *token, Void callback);
2014-09-17 13:03:04 -07:00
void addConsoleActionP(const char *token, VoidPtr callback, void *param);
2014-08-29 07:52:33 -07:00
void addConsoleActionI(const char *token, VoidInt callback);
2014-10-21 13:03:04 -07:00
void addConsoleActionIP(const char *token, VoidIntVoidPtr callback, void *param);
2014-08-29 07:52:33 -07:00
void addConsoleActionII(const char *token, VoidIntInt callback);
2014-10-21 13:03:04 -07:00
void addConsoleActionIIP(const char *token, VoidIntIntVoidPtr callback, void *param);
2014-08-29 07:52:33 -07:00
void addConsoleActionF(const char *token, VoidFloat callback);
2014-10-21 09:04:13 -07:00
2014-08-29 07:52:33 -07:00
void addConsoleActionFF(const char *token, VoidFloatFloat callback);
2014-10-21 09:04:13 -07:00
void addConsoleActionFFP(const char *token, VoidFloatFloatVoidPtr callback, void *param);
2014-08-29 07:52:33 -07:00
void addConsoleActionS(const char *token, VoidCharPtr callback);
2014-11-18 12:03:13 -08:00
void addConsoleActionSP(const char *token, VoidCharPtrVoidPtr callback, void *param);
2014-09-20 12:03:00 -07:00
2014-08-29 07:52:33 -07:00
void addConsoleActionSS(const char *token, VoidCharPtrCharPtr callback);
2014-09-20 12:03:00 -07:00
void addConsoleActionSSP(const char *token, VoidCharPtrCharPtrVoidPtr callback, void *param);
2014-08-29 07:52:33 -07:00
void addConsoleActionSSS(const char *token, VoidCharPtrCharPtrCharPtr callback);
void addConsoleActionSSSSS(const char *token, VoidCharPtrCharPtrCharPtrCharPtrCharPtr callback);
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* RFICONSOLE_H_ */