Zephyr Project API 3.7.0
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
30/* CoAP events */
31#define _NET_COAP_LAYER NET_MGMT_LAYER_L4
32#define _NET_COAP_CODE 0x1c0
33#define _NET_COAP_IF_BASE (NET_MGMT_EVENT_BIT | \
34 NET_MGMT_LAYER(_NET_COAP_LAYER) | \
35 NET_MGMT_LAYER_CODE(_NET_COAP_CODE))
36
37struct coap_service;
38struct coap_resource;
39struct coap_observer;
40
41enum net_event_coap_cmd {
42 /* Service events */
43 NET_EVENT_COAP_CMD_SERVICE_STARTED = 1,
44 NET_EVENT_COAP_CMD_SERVICE_STOPPED,
45 /* Observer events */
46 NET_EVENT_COAP_CMD_OBSERVER_ADDED,
47 NET_EVENT_COAP_CMD_OBSERVER_REMOVED,
48};
49
55#define NET_EVENT_COAP_SERVICE_STARTED \
56 (_NET_COAP_IF_BASE | NET_EVENT_COAP_CMD_SERVICE_STARTED)
57
61#define NET_EVENT_COAP_SERVICE_STOPPED \
62 (_NET_COAP_IF_BASE | NET_EVENT_COAP_CMD_SERVICE_STOPPED)
63
67#define NET_EVENT_COAP_OBSERVER_ADDED \
68 (_NET_COAP_IF_BASE | NET_EVENT_COAP_CMD_OBSERVER_ADDED)
69
73#define NET_EVENT_COAP_OBSERVER_REMOVED \
74 (_NET_COAP_IF_BASE | NET_EVENT_COAP_CMD_OBSERVER_REMOVED)
75
81 const struct coap_service *service;
82};
83
93
94#ifdef __cplusplus
95}
96#endif
97
102#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:281
Description of CoAP resource.
Definition coap.h:263
CoAP Observer event structure.
Definition coap_mgmt.h:87
struct coap_resource * resource
The CoAP resource for which the event is emitted.
Definition coap_mgmt.h:89
struct coap_observer * observer
The observer that is added/removed.
Definition coap_mgmt.h:91
CoAP Service event structure.
Definition coap_mgmt.h:79
const struct coap_service * service
The CoAP service for which the event is emitted.
Definition coap_mgmt.h:81