Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
ieee802154_mgmt.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Intel Corporation.
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12#ifndef ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_
13#define ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_
14
15#include <net/ieee802154.h>
16#include <net/net_mgmt.h>
17
18#ifdef __cplusplus
19extern "C" {
20#endif
21
30#define _NET_IEEE802154_LAYER NET_MGMT_LAYER_L2
31#define _NET_IEEE802154_CODE 0x154
32#define _NET_IEEE802154_BASE (NET_MGMT_IFACE_BIT | \
33 NET_MGMT_LAYER(_NET_IEEE802154_LAYER) |\
34 NET_MGMT_LAYER_CODE(_NET_IEEE802154_CODE))
35#define _NET_IEEE802154_EVENT (_NET_IEEE802154_BASE | NET_MGMT_EVENT_BIT)
36
57};
58
59
60#define NET_REQUEST_IEEE802154_SET_ACK \
61 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_ACK)
62
64
65#define NET_REQUEST_IEEE802154_UNSET_ACK \
66 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_UNSET_ACK)
67
69
70#define NET_REQUEST_IEEE802154_PASSIVE_SCAN \
71 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_PASSIVE_SCAN)
72
74
75#define NET_REQUEST_IEEE802154_ACTIVE_SCAN \
76 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_ACTIVE_SCAN)
77
79
80#define NET_REQUEST_IEEE802154_CANCEL_SCAN \
81 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_CANCEL_SCAN)
82
84
85#define NET_REQUEST_IEEE802154_ASSOCIATE \
86 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_ASSOCIATE)
87
89
90#define NET_REQUEST_IEEE802154_DISASSOCIATE \
91 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_DISASSOCIATE)
92
94
95#define NET_REQUEST_IEEE802154_SET_CHANNEL \
96 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_CHANNEL)
97
99
100#define NET_REQUEST_IEEE802154_GET_CHANNEL \
101 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_CHANNEL)
102
104
105#define NET_REQUEST_IEEE802154_SET_PAN_ID \
106 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_PAN_ID)
107
109
110#define NET_REQUEST_IEEE802154_GET_PAN_ID \
111 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_PAN_ID)
112
114
115#define NET_REQUEST_IEEE802154_SET_EXT_ADDR \
116 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_EXT_ADDR)
117
119
120#define NET_REQUEST_IEEE802154_GET_EXT_ADDR \
121 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_EXT_ADDR)
122
124
125#define NET_REQUEST_IEEE802154_SET_SHORT_ADDR \
126 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_SHORT_ADDR)
127
129
130#define NET_REQUEST_IEEE802154_GET_SHORT_ADDR \
131 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_SHORT_ADDR)
132
134
135#define NET_REQUEST_IEEE802154_GET_TX_POWER \
136 (_NET_IEEE802154_BASE | \
137 NET_REQUEST_IEEE802154_CMD_GET_TX_POWER)
138
140
141#define NET_REQUEST_IEEE802154_SET_TX_POWER \
142 (_NET_IEEE802154_BASE | \
143 NET_REQUEST_IEEE802154_CMD_SET_TX_POWER)
144
146
147#ifdef CONFIG_NET_L2_IEEE802154_SECURITY
148
149#define NET_REQUEST_IEEE802154_SET_SECURITY_SETTINGS \
150 (_NET_IEEE802154_BASE | \
151 NET_REQUEST_IEEE802154_CMD_SET_SECURITY_SETTINGS)
152
153NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_IEEE802154_SET_SECURITY_SETTINGS);
154
155#define NET_REQUEST_IEEE802154_GET_SECURITY_SETTINGS \
156 (_NET_IEEE802154_BASE | \
157 NET_REQUEST_IEEE802154_CMD_GET_SECURITY_SETTINGS)
158
159NET_MGMT_DEFINE_REQUEST_HANDLER(NET_REQUEST_IEEE802154_GET_SECURITY_SETTINGS);
160
161#endif /* CONFIG_NET_L2_IEEE802154_SECURITY */
162
165};
166
167#define NET_EVENT_IEEE802154_SCAN_RESULT \
168 (_NET_IEEE802154_EVENT | NET_EVENT_IEEE802154_CMD_SCAN_RESULT)
169
170
171#define IEEE802154_IS_CHAN_SCANNED(_channel_set, _chan) \
172 (_channel_set & BIT(_chan - 1))
173#define IEEE802154_IS_CHAN_UNSCANNED(_channel_set, _chan) \
174 (!IEEE802154_IS_CHAN_SCANNED(_channel_set, _chan))
175
176/* Useful define to request all channels to be scanned,
177 * from 11 to 26 included.
178 */
179#define IEEE802154_ALL_CHANNELS (0x03FFFC00)
180
189
192
197
199 union {
202 };
203
208};
209
220 uint8_t _unused : 3;
221};
222
223#ifdef __cplusplus
224}
225#endif
226
231#endif /* ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_ */
#define NET_REQUEST_IEEE802154_ASSOCIATE
Definition: ieee802154_mgmt.h:85
#define NET_REQUEST_IEEE802154_GET_TX_POWER
Definition: ieee802154_mgmt.h:135
#define NET_REQUEST_IEEE802154_SET_TX_POWER
Definition: ieee802154_mgmt.h:141
#define NET_REQUEST_IEEE802154_SET_CHANNEL
Definition: ieee802154_mgmt.h:95
#define NET_REQUEST_IEEE802154_GET_SHORT_ADDR
Definition: ieee802154_mgmt.h:130
#define NET_REQUEST_IEEE802154_PASSIVE_SCAN
Definition: ieee802154_mgmt.h:70
net_request_ieee802154_cmd
Definition: ieee802154_mgmt.h:37
#define NET_REQUEST_IEEE802154_GET_PAN_ID
Definition: ieee802154_mgmt.h:110
#define NET_REQUEST_IEEE802154_SET_PAN_ID
Definition: ieee802154_mgmt.h:105
#define NET_REQUEST_IEEE802154_SET_SHORT_ADDR
Definition: ieee802154_mgmt.h:125
#define NET_REQUEST_IEEE802154_SET_ACK
Definition: ieee802154_mgmt.h:60
#define NET_REQUEST_IEEE802154_ACTIVE_SCAN
Definition: ieee802154_mgmt.h:75
#define NET_REQUEST_IEEE802154_DISASSOCIATE
Definition: ieee802154_mgmt.h:90
#define NET_REQUEST_IEEE802154_GET_CHANNEL
Definition: ieee802154_mgmt.h:100
net_event_ieee802154_cmd
Definition: ieee802154_mgmt.h:163
#define NET_REQUEST_IEEE802154_SET_EXT_ADDR
Definition: ieee802154_mgmt.h:115
#define NET_REQUEST_IEEE802154_CANCEL_SCAN
Definition: ieee802154_mgmt.h:80
#define NET_REQUEST_IEEE802154_GET_EXT_ADDR
Definition: ieee802154_mgmt.h:120
#define NET_REQUEST_IEEE802154_UNSET_ACK
Definition: ieee802154_mgmt.h:65
@ NET_REQUEST_IEEE802154_CMD_SET_EXT_ADDR
Definition: ieee802154_mgmt.h:49
@ NET_REQUEST_IEEE802154_CMD_GET_SHORT_ADDR
Definition: ieee802154_mgmt.h:52
@ NET_REQUEST_IEEE802154_CMD_SET_TX_POWER
Definition: ieee802154_mgmt.h:54
@ NET_REQUEST_IEEE802154_CMD_SET_PAN_ID
Definition: ieee802154_mgmt.h:47
@ NET_REQUEST_IEEE802154_CMD_PASSIVE_SCAN
Definition: ieee802154_mgmt.h:40
@ NET_REQUEST_IEEE802154_CMD_SET_CHANNEL
Definition: ieee802154_mgmt.h:45
@ NET_REQUEST_IEEE802154_CMD_GET_PAN_ID
Definition: ieee802154_mgmt.h:48
@ NET_REQUEST_IEEE802154_CMD_GET_TX_POWER
Definition: ieee802154_mgmt.h:53
@ NET_REQUEST_IEEE802154_CMD_GET_SECURITY_SETTINGS
Definition: ieee802154_mgmt.h:56
@ NET_REQUEST_IEEE802154_CMD_GET_EXT_ADDR
Definition: ieee802154_mgmt.h:50
@ NET_REQUEST_IEEE802154_CMD_ASSOCIATE
Definition: ieee802154_mgmt.h:43
@ NET_REQUEST_IEEE802154_CMD_SET_ACK
Definition: ieee802154_mgmt.h:38
@ NET_REQUEST_IEEE802154_CMD_CANCEL_SCAN
Definition: ieee802154_mgmt.h:42
@ NET_REQUEST_IEEE802154_CMD_UNSET_ACK
Definition: ieee802154_mgmt.h:39
@ NET_REQUEST_IEEE802154_CMD_SET_SECURITY_SETTINGS
Definition: ieee802154_mgmt.h:55
@ NET_REQUEST_IEEE802154_CMD_DISASSOCIATE
Definition: ieee802154_mgmt.h:44
@ NET_REQUEST_IEEE802154_CMD_GET_CHANNEL
Definition: ieee802154_mgmt.h:46
@ NET_REQUEST_IEEE802154_CMD_SET_SHORT_ADDR
Definition: ieee802154_mgmt.h:51
@ NET_REQUEST_IEEE802154_CMD_ACTIVE_SCAN
Definition: ieee802154_mgmt.h:41
@ NET_EVENT_IEEE802154_CMD_SCAN_RESULT
Definition: ieee802154_mgmt.h:164
#define IEEE802154_MAX_ADDR_LENGTH
Definition: ieee802154.h:30
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Definition: net_mgmt.h:95
IEEE 802.15.4 L2 stack public header.
Network Management API public header.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:60
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58
__UINT16_TYPE__ uint16_t
Definition: stdint.h:59
Scanning parameters.
Definition: ieee802154_mgmt.h:186
uint32_t duration
Definition: ieee802154_mgmt.h:191
uint16_t channel
Definition: ieee802154_mgmt.h:194
uint8_t len
Definition: ieee802154_mgmt.h:205
uint16_t short_addr
Definition: ieee802154_mgmt.h:201
uint16_t pan_id
Definition: ieee802154_mgmt.h:196
uint32_t channel_set
Definition: ieee802154_mgmt.h:188
uint8_t lqi
Definition: ieee802154_mgmt.h:207
uint8_t addr[IEEE802154_MAX_ADDR_LENGTH]
Definition: ieee802154_mgmt.h:200
Security parameters.
Definition: ieee802154_mgmt.h:215
uint8_t key_len
Definition: ieee802154_mgmt.h:217
uint8_t level
Definition: ieee802154_mgmt.h:219
uint8_t key_mode
Definition: ieee802154_mgmt.h:218
uint8_t key[16]
Definition: ieee802154_mgmt.h:216