19 lines
426 B
C
19 lines
426 B
C
#ifndef _MESSAGE_BUILDER_HEADER
|
|
#define _MESSAGE_BUILDER_HEADER
|
|
|
|
#include "message_parser.h"
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
|
|
enum BuildMessageErrors {
|
|
NoBuildError = 0,
|
|
PayloadBiggerThenBuffer = -1,
|
|
BufferOverFlow = -2,
|
|
};
|
|
|
|
// returns the length of msg_buffer
|
|
int build_message(uint8_t msgid, const uint8_t *payload, size_t payload_len,
|
|
uint8_t *msg_buffer, size_t msg_buffer_length);
|
|
|
|
#endif
|