2022-05-19 08:57:38 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdarg.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
|
|
|
#include "uart.h"
|
|
|
|
#include "iap.h"
|
|
|
|
#include "crc.h"
|
|
|
|
|
2022-05-19 15:37:51 -04:00
|
|
|
#define DELIMIERS ','
|
2022-05-19 08:57:38 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct cmd {
|
|
|
|
char** argv; // a first command splitted as arguments in the argv style
|
|
|
|
int argc; // number of arguments in the first command
|
|
|
|
} cmd_t;
|
|
|
|
|
|
|
|
|
|
|
|
void uart_commands_getid(error_code* status);
|
|
|
|
|
|
|
|
void uart_commands_getserial(error_code* status);
|
|
|
|
|
|
|
|
crc_t uart_commands_prog(void);
|
|
|
|
|
2022-05-19 15:37:51 -04:00
|
|
|
error_code uart_commands_data(error_code* status, int size, crc_t* checksum_global, crc_t checksum_loc, int offset);
|
|
|
|
|
|
|
|
error_code uart_commands_check(crc_t crc_received, crc_t crc_calculated);
|
2022-05-19 08:57:38 -04:00
|
|
|
|
|
|
|
int uart_parse_command(char *user_input, cmd_t *cmd);
|
|
|
|
|
|
|
|
uint32_t uart_string_to_int(const char* str);
|