|
PixelKey
NeoPixel USB Key
|
Functions | |
| static char * | trim (char *str) |
| Removes white-space from an input string; replaces trailing white-space with NULL character. More... | |
| static void | lower (char *str) |
| Converts a string to lower-case. More... | |
| static pixelkey_error_t | parse_no_args (cmd_type_t type, char *arg_ctx, cmd_t *p_cmd) |
| Parses a command that takes no arguments. More... | |
| static pixelkey_error_t | parse_config_get (char *arg_ctx, cmd_t *p_cmd) |
| Parses config-get command arguments. More... | |
| static pixelkey_error_t | parse_config_set (char *arg_ctx, cmd_t *p_cmd) |
| Parses config-set command arguments. More... | |
| static pixelkey_error_t | parse_time_set (char *arg_ctx, cmd_t *p_cmd) |
| Parses time-set command arguments. More... | |
| static pixelkey_error_t | parse_keyframe (char *cmd_tok, cmd_t *p_cmd) |
| Parses a keyframe command. More... | |
| pixelkey_error_t | pixelkey_command_parse (char *command_str, cmd_list_t **p_cmd_list) |
| Parses a command string. More... | |
| static uint8_t | char_to_u8 (char c) |
| Converts a character to an integer. More... | |
| void | pixelkey_cmd_free (cmd_t *p_cmd) |
| void | pixelkey_cmd_list_free (cmd_list_t *p_cmd_list) |
|
static |
Converts a character to an integer.
| c | Character to convert. |
| UINT8_MAX | On non-digit character. |
|
static |
Converts a string to lower-case.
| [in,out] | str | String to transform. |
|
static |
Parses config-get command arguments.
| [in] | arg_ctx | Argument tokenizer context. |
| [in,out] | p_cmd | Pointer to the command structure to populate. |
| PIXELKEY_ERROR_NOT_ENOUGH_ARGUMENTS | Configuration key was not provided. |
| PIXELKEY_ERROR_INVALID_ARGUMENT | Configuration key is invalid or too long. |
| PIXELKEY_ERROR_TOO_MANY_ARGUMENTS | Additional, unexpected arguments were specified. |
| PIXELKEY_ERROR_OUT_OF_MEMORY | Failed to malloc argument structure. |
| PIXELKEY_ERROR_NONE | Parsing was successful. |
|
static |
Parses config-set command arguments.
| [in] | arg_ctx | Argument tokenizer context. |
| [in,out] | p_cmd | Pointer to the command structure to populate. |
| PIXELKEY_ERROR_NOT_ENOUGH_ARGUMENTS | Configuration key or value was not provided. |
| PIXELKEY_ERROR_INVALID_ARGUMENT | Configuration key or value is invalid or too long. |
| PIXELKEY_ERROR_TOO_MANY_ARGUMENTS | Additional, unexpected arguments were specified. |
| PIXELKEY_ERROR_OUT_OF_MEMORY | Failed to malloc argument structure. |
| PIXELKEY_ERROR_NONE | Parsing was successful. |
|
static |
Parses a keyframe command.
| [in] | cmd_tok | Command token representing the keyframe. |
| [in,out] | p_cmd | Pointer to the command structure to populate. |
| PIXELKEY_ERROR_NOT_ENOUGH_ARGUMENTS | Required keyframe arguments were not provided. |
| PIXELKEY_ERROR_INVALID_ARGUMENT | A keyframe argument was invalid or too long. |
| PIXELKEY_ERROR_TOO_MANY_ARGUMENTS | Additional, unexpected arguments were specified. |
| PIXELKEY_ERROR_OUT_OF_MEMORY | Failed to malloc argument structure. |
| PIXELKEY_ERROR_NONE | Parsing was successful. |
|
static |
Parses a command that takes no arguments.
| type | The command type to return. | |
| [in] | arg_ctx | Argument tokenizer context. |
| [in,out] | p_cmd | Pointer to the command structure to populate. |
| PIXELKEY_ERROR_TOO_MANY_ARGUMENTS | Additional arguments were specified; expects no arguments. |
| PIXELKEY_ERROR_NONE | Parsing was successful. |
|
static |
Parses time-set command arguments.
| [in] | arg_ctx | Argument tokenizer context. |
| [in,out] | p_cmd | Pointer to the command structure to populate. |
| PIXELKEY_ERROR_NOT_ENOUGH_ARGUMENTS | Time string was not provided. |
| PIXELKEY_ERROR_INVALID_ARGUMENT | Time string is invalid or too long. |
| PIXELKEY_ERROR_TOO_MANY_ARGUMENTS | Additional, unexpected arguments were specified. |
| PIXELKEY_ERROR_OUT_OF_MEMORY | Failed to malloc argument structure. |
| PIXELKEY_ERROR_NONE | Parsing was successful. |
| pixelkey_error_t pixelkey_command_parse | ( | char * | command_str, |
| cmd_list_t ** | p_cmd_list | ||
| ) |
Parses a command string.
| [in] | command_str | Pointer to the command string to parse. |
| [out] | p_cmd_list | Pointer to store the command list. |
|
static |
Removes white-space from an input string; replaces trailing white-space with NULL character.
| [in] | str | String to trim. |