|
|
|
@ -36,7 +36,7 @@ struct MessagesMap_t {
|
|
|
|
|
char dir; // i = in, o = out
|
|
|
|
|
uint16_t msg_id;
|
|
|
|
|
const pb_field_t *fields;
|
|
|
|
|
void (*process_func)(void *ptr);
|
|
|
|
|
void (*process_func)(const void *ptr);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static const struct MessagesMap_t MessagesMap[] = {
|
|
|
|
@ -222,7 +222,7 @@ enum {
|
|
|
|
|
|
|
|
|
|
void msg_process(char type, uint16_t msg_id, const pb_field_t *fields, uint8_t *msg_raw, uint32_t msg_size)
|
|
|
|
|
{
|
|
|
|
|
static CONFIDENTIAL uint8_t msg_data[MSG_IN_SIZE];
|
|
|
|
|
static uint8_t msg_data[MSG_IN_SIZE];
|
|
|
|
|
memzero(msg_data, sizeof(msg_data));
|
|
|
|
|
pb_istream_t stream = pb_istream_from_buffer(msg_raw, msg_size);
|
|
|
|
|
bool status = pb_decode(&stream, fields, msg_data);
|
|
|
|
@ -236,7 +236,7 @@ void msg_process(char type, uint16_t msg_id, const pb_field_t *fields, uint8_t *
|
|
|
|
|
void msg_read_common(char type, const uint8_t *buf, uint32_t len)
|
|
|
|
|
{
|
|
|
|
|
static char read_state = READSTATE_IDLE;
|
|
|
|
|
static CONFIDENTIAL uint8_t msg_in[MSG_IN_SIZE];
|
|
|
|
|
static uint8_t msg_in[MSG_IN_SIZE];
|
|
|
|
|
static uint16_t msg_id = 0xFFFF;
|
|
|
|
|
static uint32_t msg_size = 0;
|
|
|
|
|
static uint32_t msg_pos = 0;
|
|
|
|
|