Line data Source code
1 1 : /*
2 : * Copyright (c) 2019, Prevas A/S
3 : * Copyright (c) 2023 Nordic Semiconductor ASA
4 : *
5 : * SPDX-License-Identifier: Apache-2.0
6 : */
7 :
8 : /**
9 : * @file
10 : * @brief UDP transport for the MCUmgr SMP protocol.
11 : * @ingroup mcumgr_transport_udp
12 : */
13 :
14 : #ifndef ZEPHYR_INCLUDE_MGMT_SMP_UDP_H_
15 : #define ZEPHYR_INCLUDE_MGMT_SMP_UDP_H_
16 :
17 : /**
18 : * @brief This allows to use the MCUmgr SMP protocol over UDP.
19 : * @defgroup mcumgr_transport_udp UDP transport
20 : * @ingroup mcumgr_transport
21 : * @{
22 : */
23 :
24 : #ifdef __cplusplus
25 : extern "C" {
26 : #endif
27 :
28 : /**
29 : * @brief Enables the UDP SMP MCUmgr transport thread(s) which will open a socket and
30 : * listen to requests.
31 : *
32 : * @note API is not thread safe.
33 : *
34 : * @return 0 on success
35 : * @return -errno code on failure.
36 : */
37 1 : int smp_udp_open(void);
38 :
39 : /**
40 : * @brief Disables the UDP SMP MCUmgr transport thread(s) which will close open sockets.
41 : *
42 : * @note API is not thread safe.
43 : *
44 : * @return 0 on success
45 : * @return -errno code on failure.
46 : */
47 1 : int smp_udp_close(void);
48 :
49 : #ifdef __cplusplus
50 : }
51 : #endif
52 :
53 : /**
54 : * @}
55 : */
56 :
57 : #endif
|