2#ifndef INCLUDE_GUARD__TELECOMMAND_PARSER_H__
3#define INCLUDE_GUARD__TELECOMMAND_PARSER_H__
9#define TCMD_ARGS_STR_NO_PARENS_SIZE 255
11#define TCMD_PREFIX_STR "CTS1+"
12#define TCMD_PREFIX_STR_LEN 5
24uint8_t
TCMD_process_suffix_tag_sha256(
const char *tcmd_suffix_tag_str,
const uint16_t tcmd_suffix_tag_str_len,
const char * tcmd_str,
const int32_t end_of_args_idx);
30uint8_t
TCMD_get_suffix_tag_str(
const char *str,
const char *tag_name,
char *value_dest, uint16_t value_dest_max_len);
Definition telecommand_types.h:37
uint8_t TCMD_process_suffix_tag_tsexec(const char *tcmd_suffix_tag_str, const uint16_t tcmd_suffix_tag_str_len, uint64_t *tsexec_time_ms)
Parses the @tsexec=xxxx tag from the telecommand string.
Definition telecommand_parser.c:508
uint8_t TCMD_process_suffix_tag_tssent(const char *tcmd_suffix_tag_str, const uint16_t tcmd_suffix_tag_str_len, uint64_t *tssent_time_ms)
Parses the @tssent=xxxx tag from the telecommand string.
Definition telecommand_parser.c:482
uint8_t TCMD_get_suffix_tag_str(const char *str, const char *tag_name, char *value_dest, uint16_t value_dest_max_len)
Searches for a str like \@tag_name=xxxx, and sets char array xxxx into value_dest.
Definition telecommand_parser.c:229
uint8_t TCMD_process_suffix_tag_resp_fname(const char *tcmd_suffix_tag_str, const uint16_t tcmd_suffix_tag_str_len, char *resp_fname, const uint8_t resp_fname_len)
Parses the @resp_fname=xxxx tag from the telecommand string.
Definition telecommand_parser.c:586
uint8_t TCMD_get_suffix_tag_hex_array(const char *str, const char *tag_name, uint8_t *value_dest)
Searches for a str like \@tag_name=xxxx, and sets uint8_t array xxxx into value_dest.
Definition telecommand_parser.c:168
uint8_t TCMD_process_suffix_tag_sha256(const char *tcmd_suffix_tag_str, const uint16_t tcmd_suffix_tag_str_len, const char *tcmd_str, const int32_t end_of_args_idx)
Parses the @sha256=xxxx tag from the telecommand string.
Definition telecommand_parser.c:534
uint8_t TCMD_is_char_valid_telecommand_name_char(char c)
Returns whether a character is a valid character in a telecommand name.
Definition telecommand_parser.c:34
uint8_t TCMD_is_char_alphanumeric(char c)
Returns whether a character is alphanumeric (0-9, A-Z, a-z).
Definition telecommand_parser.c:20
static const uint8_t TCMD_SHA256_LENGTH_BYTES
Definition telecommand_parser.h:14
uint8_t TCMD_get_suffix_tag_uint64(const char *str, const char *tag_name, uint64_t *value_dest)
Searches for a str like \@tag_name=xxxx, and sets uint64_t xxxx into out_value.
Definition telecommand_parser.c:111
uint8_t TCMD_parse_full_telecommand(const char tcmd_str[], TCMD_parsed_tcmd_to_execute_t *parsed_tcmd_output)
Parses a telecommand into everything needed to execute it.
Definition telecommand_parser.c:286
uint8_t TCMD_check_starts_with_device_id(const char *tcmd_str, uint32_t tcmd_str_len)
Returns whether tcmd_str starts with CTS1+ (TCMD_PREFIX_STR).
Definition telecommand_parser.c:43
int32_t TCMD_parse_telecommand_get_index(const char *tcmd_str, uint32_t tcmd_str_len)
Finds an index into TCMD_telecommand_definitions for the given telecommand string.
Definition telecommand_parser.c:64