21typedef void (*cobs_callback_t)(
void *user_data,
const uint8_t *data,
size_t length);
33 cobs_callback_t callback;
40 size_t bytes_until_next_code;
59 cobs_callback_t callback,
98u_cobs_encode(
const uint8_t *input,
size_t input_length, uint8_t *output,
size_t output_size);
int u_cobs_encode(const uint8_t *input, size_t input_length, uint8_t *output, size_t output_size)
Encodes a single packet using COBS.
Definition u_cobs.c:123
int u_cobs_push_bytes(struct u_cobs_decoder *cobs, const uint8_t *data, size_t length)
Pushes bytes into the COBS decoder.
Definition u_cobs.c:49
int u_cobs_decoder_create(size_t buffer_size, cobs_callback_t callback, void *user_data, struct u_cobs_decoder *out_decoder)
Creates a new COBS decoder.
Definition u_cobs.c:21
void u_cobs_decoder_destroy(struct u_cobs_decoder *cobs)
Destroys a COBS decoder previously created by u_cobs_decoder_create.
Definition u_cobs.c:41
A streaming COBS (Consistent Overhead Byte Stuffing) decoder with automatic error recovery.
Definition u_cobs.h:32
bool error_recovery
Whether we're in error recovery mode (trying to reach a 0x00 delimiter)
Definition u_cobs.h:43
Header holding common defines.