summaryrefslogtreecommitdiff
path: root/prototype/fw/src/microcobs.h
blob: 05ae45e9833a5259eb419c116ef9dc97666b83a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#ifndef __MICROCOBS_H__
#define __MICROCOBS_H__

#include <stdint.h>
#include <unistd.h>

struct sg_entry {
	uint8_t *target;
	ssize_t size;
};

ssize_t cobs_encode_sg(const struct sg_entry input[], uint8_t *output, size_t output_len);
ssize_t cobs_encode(const uint8_t *input, size_t input_len, uint8_t *output, size_t output_len);
ssize_t cobs_decode(const uint8_t *input, size_t input_len, uint8_t *output, size_t output_len);

#endif /* __MICROCOBS_H__ */