Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
buf.h File Reference
#include <inttypes.h>
#include "tinycbor/cbor.h"
#include "tinycbor/cbor_buf_writer.h"

Go to the source code of this file.

Data Structures

struct  cbor_nb_reader
 
struct  cbor_nb_writer
 

Functions

struct net_bufmcumgr_buf_alloc (void)
 Allocates a net_buf for holding an mcumgr request or response. More...
 
void mcumgr_buf_free (struct net_buf *nb)
 Frees an mcumgr net_buf. More...
 
void cbor_nb_writer_init (struct cbor_nb_writer *cnw, struct net_buf *nb)
 Initializes a CBOR writer with the specified net_buf. More...
 
void cbor_nb_reader_init (struct cbor_nb_reader *cnr, struct net_buf *nb)
 Initializes a CBOR reader with the specified net_buf. More...
 

Function Documentation

◆ cbor_nb_reader_init()

void cbor_nb_reader_init ( struct cbor_nb_reader cnr,
struct net_buf nb 
)

Initializes a CBOR reader with the specified net_buf.

Parameters
cnrThe reader to initialize.
nbThe net_buf that the reader will read from.

◆ cbor_nb_writer_init()

void cbor_nb_writer_init ( struct cbor_nb_writer cnw,
struct net_buf nb 
)

Initializes a CBOR writer with the specified net_buf.

Parameters
cnwThe writer to initialize.
nbThe net_buf that the writer will write to.

◆ mcumgr_buf_alloc()

struct net_buf * mcumgr_buf_alloc ( void  )

Allocates a net_buf for holding an mcumgr request or response.

Returns
A newly-allocated buffer net_buf on success; NULL on failure.

◆ mcumgr_buf_free()

void mcumgr_buf_free ( struct net_buf nb)

Frees an mcumgr net_buf.

Parameters
nbThe net_buf to free.