diff options
Diffstat (limited to 'gm_platform/fw/cobs.h')
-rw-r--r-- | gm_platform/fw/cobs.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gm_platform/fw/cobs.h b/gm_platform/fw/cobs.h new file mode 100644 index 0000000..40f7955 --- /dev/null +++ b/gm_platform/fw/cobs.h @@ -0,0 +1,23 @@ +#ifndef __COBS_H__ +#define __COBS_H__ + +#include <stdint.h> +#include <unistd.h> +#include <string.h> + + +struct cobs_decode_state { + size_t p; + size_t c; +}; + + +ssize_t cobs_encode(char *dst, size_t dstlen, char *src, size_t srclen); +ssize_t cobs_decode(char *dst, size_t dstlen, char *src, size_t srclen); + +int cobs_encode_usart(char *src, size_t srclen); + +void cobs_decode_incremental_initialize(struct cobs_decode_state *state); +int cobs_decode_incremental(struct cobs_decode_state *state, char *dst, size_t dstlen, char src); + +#endif//__COBS_H__ |