Zephyr Project API  3.2.0
A Scalable Open Source RTOS
buf.h
Go to the documentation of this file.
1/*
2 * Copyright Runtime.io 2018. All rights reserved.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef ZEPHYR_INCLUDE_MGMT_BUF_H_
8#define ZEPHYR_INCLUDE_MGMT_BUF_H_
9
10#include <inttypes.h>
11#include <zcbor_common.h>
12#include <zcbor_encode.h>
13struct net_buf;
14
16 struct net_buf *nb;
17 /* CONFIG_MGMT_MAX_DECODING_LEVELS + 2 translates to minimal
18 * zcbor backup states.
19 */
20 zcbor_state_t zs[CONFIG_MGMT_MAX_DECODING_LEVELS + 2];
21};
22
24 struct net_buf *nb;
25 zcbor_state_t zs[2];
26};
27
35
41void mcumgr_buf_free(struct net_buf *nb);
42
50 struct net_buf *nb);
51
59 struct net_buf *nb);
60
61#endif
void cbor_nb_writer_init(struct cbor_nb_writer *cnw, struct net_buf *nb)
Initializes a CBOR writer with the specified net_buf.
void mcumgr_buf_free(struct net_buf *nb)
Frees an mcumgr net_buf.
struct net_buf * mcumgr_buf_alloc(void)
Allocates a net_buf for holding an mcumgr request or response.
void cbor_nb_reader_init(struct cbor_nb_reader *cnr, struct net_buf *nb)
Initializes a CBOR reader with the specified net_buf.
Definition: buf.h:15
struct net_buf * nb
Definition: buf.h:16
zcbor_state_t zs[CONFIG_MGMT_MAX_DECODING_LEVELS+2]
Definition: buf.h:20
Definition: buf.h:23
zcbor_state_t zs[2]
Definition: buf.h:25
struct net_buf * nb
Definition: buf.h:24
Network buffer representation.
Definition: buf.h:914