Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
coap_mgmt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Basalte bv
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_NET_COAP_MGMT_H_
13#define ZEPHYR_INCLUDE_NET_COAP_MGMT_H_
14
15#include <zephyr/net/net_mgmt.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
32/* CoAP events */
33#define _NET_COAP_LAYER NET_MGMT_LAYER_L4
34#define _NET_COAP_CODE 0x1c0
35#define _NET_COAP_IF_BASE (NET_MGMT_EVENT_BIT | \
36 NET_MGMT_LAYER(_NET_COAP_LAYER) | \
37 NET_MGMT_LAYER_CODE(_NET_COAP_CODE))
38
39struct coap_service;
40struct coap_resource;
41struct coap_observer;
42
43enum net_event_coap_cmd {
44 /* Service events */
45 NET_EVENT_COAP_CMD_SERVICE_STARTED = 1,
46 NET_EVENT_COAP_CMD_SERVICE_STOPPED,
47 /* Observer events */
48 NET_EVENT_COAP_CMD_OBSERVER_ADDED,
49 NET_EVENT_COAP_CMD_OBSERVER_REMOVED,
50};
51
57#define NET_EVENT_COAP_SERVICE_STARTED \
58 (_NET_COAP_IF_BASE | NET_EVENT_COAP_CMD_SERVICE_STARTED)
59
63#define NET_EVENT_COAP_SERVICE_STOPPED \
64 (_NET_COAP_IF_BASE | NET_EVENT_COAP_CMD_SERVICE_STOPPED)
65
69#define NET_EVENT_COAP_OBSERVER_ADDED \
70 (_NET_COAP_IF_BASE | NET_EVENT_COAP_CMD_OBSERVER_ADDED)
71
75#define NET_EVENT_COAP_OBSERVER_REMOVED \
76 (_NET_COAP_IF_BASE | NET_EVENT_COAP_CMD_OBSERVER_REMOVED)
77
83 const struct coap_service *service;
84};
85
95
96#ifdef __cplusplus
97}
98#endif
99
104#endif /* ZEPHYR_INCLUDE_NET_COAP_MGMT_H_ */
Network Management API public header.
Represents a remote device that is observing a local resource.
Definition coap.h:298
Description of CoAP resource.
Definition coap.h:280
CoAP Observer event structure.
Definition coap_mgmt.h:89
struct coap_resource * resource
The CoAP resource for which the event is emitted.
Definition coap_mgmt.h:91
struct coap_observer * observer
The observer that is added/removed.
Definition coap_mgmt.h:93
CoAP Service event structure.
Definition coap_mgmt.h:81
const struct coap_service * service
The CoAP service for which the event is emitted.
Definition coap_mgmt.h:83