25 lines
442 B
C
25 lines
442 B
C
#ifndef PACKET_H
|
|
#define PACKET_H
|
|
|
|
#include <stdint.h>
|
|
|
|
#include "decoder.h"
|
|
#include "encoder.h"
|
|
|
|
#define PREAMBLE_SYMBOLS 128
|
|
#define PREAMBLE_CHECK_SYMBOLS 16
|
|
|
|
#define MAGIC0 0xA5
|
|
#define MAGIC1 0x5A
|
|
#define MAGIC2 0xC3
|
|
#define MAGIC3 0x3C
|
|
|
|
#define MAX_PACKET 1024
|
|
|
|
uint16_t crc16(const uint8_t *data, uint32_t len);
|
|
|
|
void encoder_build_packet(Encoder *enc, uint8_t *data, uint8_t length);
|
|
|
|
bool decoder_parse_packet(Decoder *dec);
|
|
|
|
#endif |