1#ifndef PIXELKEY_COMMANDS_H
2#define PIXELKEY_COMMANDS_H
18#define CMD_PREFIX ('$')
21#define CMD_REPEAT_MOD_PREFIX ('^')
24#define CMD_SCHEDULE_MOD_PREFIX ('@')
27#define CMD_GROUP_BEGIN_MOD_PREFIX ('{')
30#define CMD_GROUP_END_MOD_PREFIX ('}')
33#define CMD_CONFIG_KEY_MAX_LENGTH (32)
35#define CMD_TIME_SET_MAX_LENGTH (26)
38#define CMD_KEYFRAME_WRAPPER_CHANNELS_MAX_LENGTH (16)
41#define CMD_KEYFRAME_MAX_CHANNEL_NUMBER (0x7FFF)
44typedef enum e_cmd_type
65typedef enum e_value_type
73typedef struct st_cmd_args_keyframe_wrapper
80typedef struct st_cmd_args_config_get
86typedef struct st_cmd_args_config_set
101typedef struct st_cmd_args_time_set
118typedef struct st_cmd_args_keyframe_mod_repeat
124typedef struct st_cmd_args_keyframe_mod_schedule
137typedef struct st_cmd_list
143void pixelkey_cmd_free(
cmd_t * p_cmd);
144void pixelkey_cmd_list_free(
cmd_list_t * p_cmd_list);
cmd_type_t
Command types.
Definition: pixelkey_commands.h:45
value_type_t
Value types.
Definition: pixelkey_commands.h:66
#define CMD_CONFIG_KEY_MAX_LENGTH
Max string length for configuration keys.
Definition: pixelkey_commands.h:33
#define CMD_KEYFRAME_WRAPPER_CHANNELS_MAX_LENGTH
Maximum length of the index array for keyfrmaes.
Definition: pixelkey_commands.h:38
pixelkey_error_t pixelkey_command_parse(char *command_str, cmd_list_t **p_cmd_list)
Parses a command string.
Definition: command_parser.c:34
@ CMD_TYPE_UNDEFINED
Undefined command.
Definition: pixelkey_commands.h:46
@ CMD_TYPE_COUNT
Total number of command types.
Definition: pixelkey_commands.h:61
@ CMD_TYPE_CONFIG_GET
Get a configuration value.
Definition: pixelkey_commands.h:51
@ CMD_TYPE_STOP
Stop keyframe processing and go idle.
Definition: pixelkey_commands.h:54
@ CMD_TYPE_REBOOT
Triggers a software reset of the micro.
Definition: pixelkey_commands.h:60
@ CMD_TYPE_TIME_GET
Get the current system time.
Definition: pixelkey_commands.h:57
@ CMD_TYPE_CONFIG_SET
Set a configuration value.
Definition: pixelkey_commands.h:52
@ CMD_TYPE_KEYFRAME_MOD_GROUP
Keyframe group modifier command.
Definition: pixelkey_commands.h:50
@ CMD_TYPE_STATUS
Display device status.
Definition: pixelkey_commands.h:55
@ CMD_TYPE_KEYFRAME_MOD_SCHEDULE
Keyframe schedule modifier command.
Definition: pixelkey_commands.h:49
@ CMD_TYPE_HELP
Displays a help message.
Definition: pixelkey_commands.h:59
@ CMD_TYPE_KEYFRAME_MOD_REPEAT
Keyframe repeat modifier command.
Definition: pixelkey_commands.h:48
@ CMD_TYPE_KEYFRAME_WRAPPER
Command wrapper around a keyframe.
Definition: pixelkey_commands.h:47
@ CMD_TYPE_TIME_SET
Set the current system time.
Definition: pixelkey_commands.h:58
@ CMD_TYPE_RESUME
Resume keyframe processing.
Definition: pixelkey_commands.h:53
@ CMD_TYPE_VERSION
Display device firmware version.
Definition: pixelkey_commands.h:56
@ VALUE_TYPE_FLOAT
Float value.
Definition: pixelkey_commands.h:69
@ VALUE_TYPE_BOOLEAN
Boolean value.
Definition: pixelkey_commands.h:67
@ VALUE_TYPE_INTEGER
Integer value.
Definition: pixelkey_commands.h:68
pixelkey_error_t
PixelKey errors.
Definition: pixelkey_errors.h:11
Arguments to config-set command.
Definition: pixelkey_commands.h:81
Arguments to config-set command.
Definition: pixelkey_commands.h:87
int32_t i32
Integer config value.
Definition: pixelkey_commands.h:93
float f32
Float config value.
Definition: pixelkey_commands.h:94
value_type_t value_type
Type for value.
Definition: pixelkey_commands.h:90
bool b
Boolean config value.
Definition: pixelkey_commands.h:95
Arguments for repeat keyframe modifier command.
Definition: pixelkey_commands.h:119
int32_t repeat_count
Number of repeats to perform, -1 is indefinite, 0 = 1.
Definition: pixelkey_commands.h:120
Arguments for schedule keyframe modifier command.
Definition: pixelkey_commands.h:125
Command which wraps a keyframe.
Definition: pixelkey_commands.h:74
keyframe_base_t * p_keyframe
Pointer to the parsed keyframe.
Definition: pixelkey_commands.h:75
Arguments to time-set command.
Definition: pixelkey_commands.h:102
uint8_t tz_minute
Time-zone minute offset.
Definition: pixelkey_commands.h:113
uint8_t second
Second.
Definition: pixelkey_commands.h:111
uint8_t minute
Minute.
Definition: pixelkey_commands.h:110
uint8_t day
Day.
Definition: pixelkey_commands.h:108
uint8_t tz_hour
Time-zone hour offset (MSB signifies sign).
Definition: pixelkey_commands.h:112
uint8_t hour
Hour (24).
Definition: pixelkey_commands.h:109
uint16_t year
Year.
Definition: pixelkey_commands.h:106
uint8_t month
Month.
Definition: pixelkey_commands.h:107
Parsed command list.
Definition: pixelkey_commands.h:138
struct st_cmd_list * p_next
Pointer to the next command list element.
Definition: pixelkey_commands.h:140
cmd_t * p_cmd
Pointer to the current command.
Definition: pixelkey_commands.h:139
Parsed command and arguments.
Definition: pixelkey_commands.h:131
cmd_type_t type
Command type.
Definition: pixelkey_commands.h:132
void * p_args
Pointer to command arguments.
Definition: pixelkey_commands.h:133