nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
dect_net_l2_mgmt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
13#ifndef DECT_NET_L2_MGMT_H_
14#define DECT_NET_L2_MGMT_H_
15
16#include <zephyr/net/net_mgmt.h>
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
35#define _NET_DECT_LAYER NET_MGMT_LAYER_L2
36#define _NET_DECT_CODE NET_MGMT_LAYER_CODE_USER1
37#define _NET_DECT_BASE \
38 (NET_MGMT_IFACE_BIT | NET_MGMT_LAYER(_NET_DECT_LAYER) | NET_MGMT_LAYER_CODE(_NET_DECT_CODE))
39#define _NET_DECT_EVENT (_NET_DECT_BASE | NET_MGMT_EVENT_BIT)
40
41enum net_request_dect_cmd {
43 NET_REQUEST_DECT_CMD_ACTIVATE = 1,
44
46 NET_REQUEST_DECT_CMD_DEACTIVATE,
47
49 NET_REQUEST_DECT_CMD_RSSI_SCAN,
50
52 NET_REQUEST_DECT_CMD_SCAN,
53
55 NET_REQUEST_DECT_CMD_ASSOCIATION_REQ,
56
58 NET_REQUEST_DECT_CMD_ASSOCIATION_RELEASE,
59
61 NET_REQUEST_DECT_CMD_CLUSTER_START_REQ,
62
64 NET_REQUEST_DECT_CMD_CLUSTER_RECONFIG_REQ,
65
67 NET_REQUEST_DECT_CMD_CLUSTER_STOP_REQ,
68
70 NET_REQUEST_DECT_CMD_NW_BEACON_START_REQ,
71
73 NET_REQUEST_DECT_CMD_NW_BEACON_STOP_REQ,
74
76 NET_REQUEST_DECT_CMD_NETWORK_CREATE_REQ,
77
79 NET_REQUEST_DECT_CMD_NETWORK_REMOVE_REQ,
80
82 NET_REQUEST_DECT_CMD_NETWORK_JOIN,
83
85 NET_REQUEST_DECT_CMD_NETWORK_UNJOIN,
86
88 NET_REQUEST_DECT_CMD_SETTINGS_READ,
89
91 NET_REQUEST_DECT_CMD_SETTINGS_WRITE,
92
94 NET_REQUEST_DECT_CMD_STATUS_INFO_GET,
95
97 NET_REQUEST_DECT_CMD_NEIGHBOR_LIST_REQ,
98
100 NET_REQUEST_DECT_CMD_NEIGHBOR_INFO_REQ,
101
103 NET_REQUEST_DECT_CMD_CLUSTER_INFO_REQ,
104};
105
122#define NET_REQUEST_DECT_ACTIVATE (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_ACTIVATE)
123NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_ACTIVATE);
124
126#define NET_REQUEST_DECT_DEACTIVATE (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_DEACTIVATE)
127NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_DEACTIVATE);
128
134#define NET_REQUEST_DECT_RSSI_SCAN (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_RSSI_SCAN)
135NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_RSSI_SCAN);
136
142#define NET_REQUEST_DECT_SCAN (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_SCAN)
143NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_SCAN);
144
150#define NET_REQUEST_DECT_ASSOCIATION (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_ASSOCIATION_REQ)
151
152NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_ASSOCIATION);
153
159#define NET_REQUEST_DECT_ASSOCIATION_RELEASE \
160 (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_ASSOCIATION_RELEASE)
161NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_ASSOCIATION_RELEASE);
162
164#define NET_REQUEST_DECT_CLUSTER_START (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_CLUSTER_START_REQ)
165NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_CLUSTER_START);
166
168#define NET_REQUEST_DECT_CLUSTER_RECONFIGURE \
169 (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_CLUSTER_RECONFIG_REQ)
170NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_CLUSTER_RECONFIGURE);
171
173#define NET_REQUEST_DECT_CLUSTER_STOP (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_CLUSTER_STOP_REQ)
174NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_CLUSTER_STOP);
175
181#define NET_REQUEST_DECT_NW_BEACON_START (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_NW_BEACON_START_REQ)
182NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_NW_BEACON_START);
183
185#define NET_REQUEST_DECT_NW_BEACON_STOP (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_NW_BEACON_STOP_REQ)
186NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_NW_BEACON_STOP);
187
189#define NET_REQUEST_DECT_SETTINGS_READ (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_SETTINGS_READ)
190NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_SETTINGS_READ);
191
197#define NET_REQUEST_DECT_SETTINGS_WRITE (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_SETTINGS_WRITE)
198NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_SETTINGS_WRITE);
199
201#define NET_REQUEST_DECT_STATUS_INFO_GET (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_STATUS_INFO_GET)
202NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_STATUS_INFO_GET);
203
205#define NET_REQUEST_DECT_NEIGHBOR_LIST (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_NEIGHBOR_LIST_REQ)
206NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_NEIGHBOR_LIST);
207
213#define NET_REQUEST_DECT_NEIGHBOR_INFO (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_NEIGHBOR_INFO_REQ)
214NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_NEIGHBOR_INFO);
215
217#define NET_REQUEST_DECT_CLUSTER_INFO (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_CLUSTER_INFO_REQ)
218NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_CLUSTER_INFO);
219
221#define NET_REQUEST_DECT_NETWORK_CREATE (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_NETWORK_CREATE_REQ)
222NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_NETWORK_CREATE);
223
225#define NET_REQUEST_DECT_NETWORK_REMOVE (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_NETWORK_REMOVE_REQ)
226NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_NETWORK_REMOVE);
227
229#define NET_REQUEST_DECT_NETWORK_JOIN (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_NETWORK_JOIN)
230NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_NETWORK_JOIN);
231
233#define NET_REQUEST_DECT_NETWORK_UNJOIN (_NET_DECT_BASE | NET_REQUEST_DECT_CMD_NETWORK_UNJOIN)
234NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_DECT_NETWORK_UNJOIN);
235
243enum {
244 NET_EVENT_DECT_CMD_ACTIVATE_DONE_VAL,
245 NET_EVENT_DECT_CMD_DEACTIVATE_DONE_VAL,
246 NET_EVENT_DECT_CMD_SCAN_RESULT_VAL,
247 NET_EVENT_DECT_CMD_SCAN_DONE_VAL,
248 NET_EVENT_DECT_CMD_RSSI_SCAN_RESULT_VAL,
249 NET_EVENT_DECT_CMD_RSSI_SCAN_DONE_VAL,
250 NET_EVENT_DECT_CMD_NETWORK_STATUS_VAL,
251 NET_EVENT_DECT_CMD_SINK_STATUS_VAL,
252 NET_EVENT_DECT_CMD_ASSOCIATION_CHANGED_VAL,
253 NET_EVENT_DECT_CMD_CLUSTER_START_RESP_VAL,
254 NET_EVENT_DECT_CMD_CLUSTER_STOPPED_RESP_VAL,
255 NET_EVENT_DECT_CMD_NW_BEACON_START_RESP_VAL,
256 NET_EVENT_DECT_CMD_NW_BEACON_STOP_RESP_VAL,
257 NET_EVENT_DECT_CMD_NEIGHBOR_LIST_RESP_VAL,
258 NET_EVENT_DECT_CMD_NEIGHBOR_INFO_RESP_VAL,
259 NET_EVENT_DECT_CMD_CLUSTER_INFO_RESP_VAL,
260
261 NET_EVENT_DECT_CMD_MAX
262};
263
264BUILD_ASSERT(NET_EVENT_DECT_CMD_MAX <= NET_MGMT_MAX_COMMANDS,
265 "Number of events in net_event_dect_cmd exceeds the limit");
266
267enum net_event_dect_cmd {
269 NET_MGMT_CMD(NET_EVENT_DECT_CMD_ACTIVATE_DONE),
271 NET_MGMT_CMD(NET_EVENT_DECT_CMD_DEACTIVATE_DONE),
273 NET_MGMT_CMD(NET_EVENT_DECT_CMD_SCAN_RESULT),
275 NET_MGMT_CMD(NET_EVENT_DECT_CMD_SCAN_DONE),
277 NET_MGMT_CMD(NET_EVENT_DECT_CMD_RSSI_SCAN_RESULT),
279 NET_MGMT_CMD(NET_EVENT_DECT_CMD_RSSI_SCAN_DONE),
281 NET_MGMT_CMD(NET_EVENT_DECT_CMD_NETWORK_STATUS),
283 NET_MGMT_CMD(NET_EVENT_DECT_CMD_SINK_STATUS),
285 NET_MGMT_CMD(NET_EVENT_DECT_CMD_ASSOCIATION_CHANGED),
287 NET_MGMT_CMD(NET_EVENT_DECT_CMD_CLUSTER_START_RESP),
289 NET_MGMT_CMD(NET_EVENT_DECT_CMD_CLUSTER_STOPPED_RESP),
291 NET_MGMT_CMD(NET_EVENT_DECT_CMD_NW_BEACON_START_RESP),
293 NET_MGMT_CMD(NET_EVENT_DECT_CMD_NW_BEACON_STOP_RESP),
295 NET_MGMT_CMD(NET_EVENT_DECT_CMD_NEIGHBOR_LIST_RESP),
297 NET_MGMT_CMD(NET_EVENT_DECT_CMD_NEIGHBOR_INFO_RESP),
299 NET_MGMT_CMD(NET_EVENT_DECT_CMD_CLUSTER_INFO_RESP),
300};
322#define NET_EVENT_DECT_ACTIVATE_DONE (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_ACTIVATE_DONE)
323
329#define NET_EVENT_DECT_DEACTIVATE_DONE (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_DEACTIVATE_DONE)
330
337#define NET_EVENT_DECT_RSSI_SCAN_RESULT (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_RSSI_SCAN_RESULT)
338
345#define NET_EVENT_DECT_RSSI_SCAN_DONE (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_RSSI_SCAN_DONE)
346
352#define NET_EVENT_DECT_SCAN_RESULT (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_SCAN_RESULT)
353
360#define NET_EVENT_DECT_SCAN_DONE (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_SCAN_DONE)
361
368#define NET_EVENT_DECT_ASSOCIATION_CHANGED \
369 (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_ASSOCIATION_CHANGED)
370
376#define NET_EVENT_DECT_NETWORK_STATUS \
377 (_NET_DECT_EVENT | \
378 NET_EVENT_DECT_CMD_NETWORK_STATUS) /* created/removed/joined/unjoined */
379
385#define NET_EVENT_DECT_SINK_STATUS \
386 (_NET_DECT_EVENT | \
387 NET_EVENT_DECT_CMD_SINK_STATUS) /* connected/disconnected */
388
393#define NET_EVENT_DECT_CLUSTER_CREATED_RESULT \
394 (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_CLUSTER_START_RESP)
395
400#define NET_EVENT_DECT_CLUSTER_STOPPED_RESULT \
401 (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_CLUSTER_STOPPED_RESP)
402
408#define NET_EVENT_DECT_NW_BEACON_START_RESULT \
409 (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_NW_BEACON_START_RESP)
410
415#define NET_EVENT_DECT_NW_BEACON_STOP_RESULT \
416 (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_NW_BEACON_STOP_RESP)
417
422#define NET_EVENT_DECT_NEIGHBOR_LIST (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_NEIGHBOR_LIST_RESP)
423
428#define NET_EVENT_DECT_NEIGHBOR_INFO (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_NEIGHBOR_INFO_RESP)
429
434#define NET_EVENT_DECT_CLUSTER_INFO (_NET_DECT_EVENT | NET_EVENT_DECT_CMD_CLUSTER_INFO_RESP)
435/* Helper functions for driver to send L2 events */
436
442void dect_mgmt_activate_done_evt(struct net_if *iface, enum dect_status_values status);
443
448void dect_mgmt_deactivate_done_evt(struct net_if *iface, enum dect_status_values status);
449
454void dect_mgmt_rssi_scan_result_evt(struct net_if *iface,
455 struct dect_rssi_scan_result_evt result_data);
456
461void dect_mgmt_rssi_scan_done_evt(struct net_if *iface, enum dect_status_values status);
462
467void dect_mgmt_association_changed_evt(struct net_if *iface,
468 struct dect_association_changed_evt evt_data);
469
475void dect_mgmt_parent_association_created_evt(struct net_if *iface, uint32_t long_rd_id);
476
482void dect_mgmt_child_association_created_evt(struct net_if *iface, uint32_t long_rd_id);
483
492void dect_mgmt_association_released_evt(struct net_if *iface, uint32_t neighbor_long_rd_id,
493 enum dect_neighbor_role neighbor_role,
494 bool neighbor_initiated,
496
503void dect_mgmt_association_req_failed_mdm_result_evt(struct net_if *iface, uint32_t long_rd_id,
504 enum dect_status_values cause);
505
513void dect_mgmt_association_req_rejected_result_evt(struct net_if *iface, uint32_t long_rd_id,
514 enum dect_association_reject_cause reject_cause,
515 enum dect_association_reject_time reject_time);
516
521void dect_mgmt_cluster_created_evt(struct net_if *iface,
522 struct dect_cluster_start_resp_evt resp_data);
523
528void dect_mgmt_cluster_stopped_evt(struct net_if *iface, enum dect_status_values status);
529
534void dect_mgmt_cluster_info_evt(struct net_if *iface, struct dect_cluster_info_evt resp_data);
535
540void dect_mgmt_network_status_evt(struct net_if *iface,
541 struct dect_network_status_evt network_status_data);
542
547void dect_mgmt_sink_status_evt(struct net_if *iface,
548 struct dect_sink_status_evt sink_status_data);
549
554void dect_mgmt_nw_beacon_start_evt(struct net_if *iface, enum dect_status_values status);
555
560void dect_mgmt_nw_beacon_stop_evt(struct net_if *iface, enum dect_status_values status);
561
566void dect_mgmt_neighbor_list_evt(struct net_if *iface, struct dect_neighbor_list_evt resp_data);
567
572void dect_mgmt_neighbor_info_evt(struct net_if *iface, struct dect_neighbor_info_evt resp_data);
573
581#ifdef __cplusplus
582}
583#endif
584
585#endif /* DECT_NET_L2_MGMT_H_ */
DECT NR+ L2 Networking Layer public header.
void dect_mgmt_association_changed_evt(struct net_if *iface, struct dect_association_changed_evt evt_data)
#define NET_REQUEST_DECT_NW_BEACON_STOP
Definition dect_net_l2_mgmt.h:185
void dect_mgmt_parent_association_created_evt(struct net_if *iface, uint32_t long_rd_id)
#define NET_REQUEST_DECT_CLUSTER_INFO
Definition dect_net_l2_mgmt.h:217
#define NET_REQUEST_DECT_SCAN
Definition dect_net_l2_mgmt.h:142
#define NET_REQUEST_DECT_NETWORK_REMOVE
Definition dect_net_l2_mgmt.h:225
#define NET_REQUEST_DECT_NW_BEACON_START
Definition dect_net_l2_mgmt.h:181
void dect_mgmt_nw_beacon_stop_evt(struct net_if *iface, enum dect_status_values status)
#define NET_REQUEST_DECT_NEIGHBOR_INFO
Definition dect_net_l2_mgmt.h:213
#define NET_REQUEST_DECT_NETWORK_CREATE
Definition dect_net_l2_mgmt.h:221
#define NET_REQUEST_DECT_CLUSTER_RECONFIGURE
Definition dect_net_l2_mgmt.h:168
void dect_mgmt_deactivate_done_evt(struct net_if *iface, enum dect_status_values status)
#define NET_REQUEST_DECT_ASSOCIATION_RELEASE
Definition dect_net_l2_mgmt.h:159
void dect_mgmt_cluster_created_evt(struct net_if *iface, struct dect_cluster_start_resp_evt resp_data)
#define NET_REQUEST_DECT_NEIGHBOR_LIST
Definition dect_net_l2_mgmt.h:205
void dect_mgmt_neighbor_info_evt(struct net_if *iface, struct dect_neighbor_info_evt resp_data)
void dect_mgmt_association_req_failed_mdm_result_evt(struct net_if *iface, uint32_t long_rd_id, enum dect_status_values cause)
void dect_mgmt_nw_beacon_start_evt(struct net_if *iface, enum dect_status_values status)
void dect_mgmt_association_released_evt(struct net_if *iface, uint32_t neighbor_long_rd_id, enum dect_neighbor_role neighbor_role, bool neighbor_initiated, enum dect_association_release_cause cause)
#define NET_REQUEST_DECT_ACTIVATE
Definition dect_net_l2_mgmt.h:122
void dect_mgmt_rssi_scan_done_evt(struct net_if *iface, enum dect_status_values status)
void dect_mgmt_cluster_info_evt(struct net_if *iface, struct dect_cluster_info_evt resp_data)
void dect_mgmt_neighbor_list_evt(struct net_if *iface, struct dect_neighbor_list_evt resp_data)
void dect_mgmt_activate_done_evt(struct net_if *iface, enum dect_status_values status)
void dect_mgmt_association_req_rejected_result_evt(struct net_if *iface, uint32_t long_rd_id, enum dect_association_reject_cause reject_cause, enum dect_association_reject_time reject_time)
#define NET_REQUEST_DECT_CLUSTER_START
Definition dect_net_l2_mgmt.h:164
void dect_mgmt_cluster_stopped_evt(struct net_if *iface, enum dect_status_values status)
#define NET_REQUEST_DECT_ASSOCIATION
Definition dect_net_l2_mgmt.h:150
#define NET_REQUEST_DECT_RSSI_SCAN
Definition dect_net_l2_mgmt.h:134
void dect_mgmt_child_association_created_evt(struct net_if *iface, uint32_t long_rd_id)
#define NET_REQUEST_DECT_NETWORK_UNJOIN
Definition dect_net_l2_mgmt.h:233
#define NET_REQUEST_DECT_SETTINGS_READ
Definition dect_net_l2_mgmt.h:189
#define NET_REQUEST_DECT_STATUS_INFO_GET
Definition dect_net_l2_mgmt.h:201
#define NET_REQUEST_DECT_CLUSTER_STOP
Definition dect_net_l2_mgmt.h:173
#define NET_REQUEST_DECT_NETWORK_JOIN
Definition dect_net_l2_mgmt.h:229
#define NET_REQUEST_DECT_DEACTIVATE
Definition dect_net_l2_mgmt.h:126
#define NET_REQUEST_DECT_SETTINGS_WRITE
Definition dect_net_l2_mgmt.h:197
void dect_mgmt_network_status_evt(struct net_if *iface, struct dect_network_status_evt network_status_data)
void dect_mgmt_rssi_scan_result_evt(struct net_if *iface, struct dect_rssi_scan_result_evt result_data)
void dect_mgmt_sink_status_evt(struct net_if *iface, struct dect_sink_status_evt sink_status_data)
dect_status_values
DECT-2020 NR Part 4: MAC specification.
Definition dect_net_l2.h:58
dect_association_release_cause
Association release causes.
Definition dect_net_l2.h:357
dect_association_reject_time
Association reject times.
Definition dect_net_l2.h:303
dect_neighbor_role
Neighbor role.
Definition dect_net_l2.h:394
dect_association_reject_cause
Association reject causes.
Definition dect_net_l2.h:283
DECT association changed event.
Definition dect_net_l2.h:414
Cluster info event.
Definition dect_net_l2.h:698
DECT cluster start resp event.
Definition dect_net_l2.h:454
Neighbor info event.
Definition dect_net_l2.h:515
Neighbor list event.
Definition dect_net_l2.h:508
DECT network status event.
Definition dect_net_l2.h:460
DECT RSSI scan result event.
Definition dect_net_l2.h:349
DECT sink status event.
Definition dect_net_l2.h:480