Zephyr Project API  3.3.0
A Scalable Open Source RTOS
smp.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018-2021 mcumgr authors
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
25#ifndef H_SMP_
26#define H_SMP_
27
28#include <zephyr/net/buf.h>
30
31#include <zcbor_common.h>
32
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
39 struct net_buf *nb;
40 /* CONFIG_MCUMGR_SMP_CBOR_MAX_DECODING_LEVELS + 2 translates to minimal
41 * zcbor backup states.
42 */
43 zcbor_state_t zs[CONFIG_MCUMGR_SMP_CBOR_MAX_DECODING_LEVELS + 2];
44};
45
47 struct net_buf *nb;
48 zcbor_state_t zs[2];
49};
50
58
64void smp_packet_free(struct net_buf *nb);
65
73
74#ifdef CONFIG_MCUMGR_SMP_VERBOSE_ERR_RESPONSE
75 const char *rc_rsn;
76#endif
77};
78
93int smp_process_request_packet(struct smp_streamer *streamer, void *req);
94
95#ifdef __cplusplus
96}
97#endif
98
99#endif /* H_SMP_ */
Buffer management.
int smp_process_request_packet(struct smp_streamer *streamer, void *req)
Processes a single SMP request packet and sends all corresponding responses.
struct net_buf * smp_packet_alloc(void)
Allocates a net_buf for holding an mcumgr request or response.
void smp_packet_free(struct net_buf *nb)
Frees an mcumgr net_buf.
Definition: smp.h:38
struct net_buf * nb
Definition: smp.h:39
zcbor_state_t zs[CONFIG_MCUMGR_SMP_CBOR_MAX_DECODING_LEVELS+2]
Definition: smp.h:43
Definition: smp.h:46
zcbor_state_t zs[2]
Definition: smp.h:48
struct net_buf * nb
Definition: smp.h:47
Network buffer representation.
Definition: buf.h:905
Decodes, encodes, and transmits SMP packets.
Definition: smp.h:69
struct cbor_nb_writer * writer
Definition: smp.h:72
struct smp_transport * smpt
Definition: smp.h:70
struct cbor_nb_reader * reader
Definition: smp.h:71
SMP transport object for sending SMP responses.
Definition: smp.h:106