summaryrefslogtreecommitdiff
path: root/firmware/src/data_link.h
blob: 45f58dcf8ac794399bd7d2637a7a47c304dae354 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#ifndef DATA_LINK_H
#define DATA_LINK_H

#include <sys/types.h>
#include <zephyr/device.h>

#define DL_SLIP_END     0xC0
#define DL_SLIP_ESC     0xDB
#define DL_SLIP_ESC_END 0xDC
#define DL_SLIP_ESC_ESC 0xDD

#define DL_MAX_FRAME_SIZE 1500

ssize_t dl_encode_frame(uint8_t *payload, size_t len, uint8_t *dst);
void dl_send_frame(const struct device *const uart_dev, uint8_t *buffer,
                   size_t len);

#endif  // DATA_LINK_H