Zephyr Project API 4.4.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

Header file for the Consistent Overhead Byte Stuffing (COBS) encoding API. More...

#include <stddef.h>
#include <sys/types.h>
#include <zephyr/sys/util.h>

Go to the source code of this file.

Data Structures

struct  cobs_encoder
 COBS streaming encoder state. More...
struct  cobs_decoder
 COBS streaming decoder state. More...

Macros

COBS Encoder/Decoder Flags

#define COBS_DEFAULT_DELIMITER   0x00
 Default COBS delimiter value.
#define COBS_FLAG_TRAILING_DELIMITER   BIT(8)
 Flag indicating that encode or decode should include a trailing delimiter.
#define COBS_FLAG_CUSTOM_DELIMITER(x)
 Macro for setting a custom delimiter in flags.

Typedefs

typedef int(* cobs_stream_cb) (const uint8_t *buf, size_t len, void *user_data)
 Callback function type for streaming COBS encoder/decoder.

Functions

static size_t cobs_max_encoded_len (size_t decoded_size, uint32_t flags)
 Calculate maximum encoded buffer size.
int cobs_encode (struct net_buf *src, struct net_buf *dst, uint32_t flags)
 COBS encoding.
int cobs_decode (struct net_buf *src, struct net_buf *dst, uint32_t flags)
 COBS decoding.
int cobs_encoder_init (struct cobs_encoder *enc, cobs_stream_cb cb, void *user_data, uint32_t flags)
 Initialize COBS streaming encoder.
int cobs_encoder_close (struct cobs_encoder *enc)
 Finalize COBS streaming encoder.
int cobs_encoder_write (struct cobs_encoder *enc, const uint8_t *buf, size_t len)
 Write data to COBS streaming encoder.
int cobs_decoder_init (struct cobs_decoder *dec, cobs_stream_cb cb, void *user_data, uint32_t flags)
 Initialize COBS streaming decoder.
int cobs_decoder_close (struct cobs_decoder *dec)
 Finalize COBS streaming decoder.
int cobs_decoder_write (struct cobs_decoder *dec, const uint8_t *buf, size_t len)
 Write data to COBS streaming decoder.

Detailed Description

Header file for the Consistent Overhead Byte Stuffing (COBS) encoding API.