Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
14#ifndef ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_
15#define ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_
16
18#include <zephyr/net/net_mgmt.h>
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
46#define _NET_IEEE802154_LAYER NET_MGMT_LAYER_L2
47#define _NET_IEEE802154_CODE 0x154
48#define _NET_IEEE802154_BASE (NET_MGMT_IFACE_BIT | \
49 NET_MGMT_LAYER(_NET_IEEE802154_LAYER) |\
50 NET_MGMT_LAYER_CODE(_NET_IEEE802154_CODE))
51#define _NET_IEEE802154_EVENT (_NET_IEEE802154_BASE | NET_MGMT_EVENT_BIT)
52
53enum net_request_ieee802154_cmd {
54 NET_REQUEST_IEEE802154_CMD_SET_ACK = 1,
55 NET_REQUEST_IEEE802154_CMD_UNSET_ACK,
56 NET_REQUEST_IEEE802154_CMD_PASSIVE_SCAN,
57 NET_REQUEST_IEEE802154_CMD_ACTIVE_SCAN,
58 NET_REQUEST_IEEE802154_CMD_CANCEL_SCAN,
59 NET_REQUEST_IEEE802154_CMD_ASSOCIATE,
60 NET_REQUEST_IEEE802154_CMD_DISASSOCIATE,
61 NET_REQUEST_IEEE802154_CMD_SET_CHANNEL,
62 NET_REQUEST_IEEE802154_CMD_GET_CHANNEL,
63 NET_REQUEST_IEEE802154_CMD_SET_PAN_ID,
64 NET_REQUEST_IEEE802154_CMD_GET_PAN_ID,
65 NET_REQUEST_IEEE802154_CMD_SET_EXT_ADDR,
66 NET_REQUEST_IEEE802154_CMD_GET_EXT_ADDR,
67 NET_REQUEST_IEEE802154_CMD_SET_SHORT_ADDR,
68 NET_REQUEST_IEEE802154_CMD_GET_SHORT_ADDR,
69 NET_REQUEST_IEEE802154_CMD_GET_TX_POWER,
70 NET_REQUEST_IEEE802154_CMD_SET_TX_POWER,
71 NET_REQUEST_IEEE802154_CMD_SET_SECURITY_SETTINGS,
72 NET_REQUEST_IEEE802154_CMD_GET_SECURITY_SETTINGS,
73};
74
109#define NET_REQUEST_IEEE802154_SET_ACK (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_ACK)
110
112
114#define NET_REQUEST_IEEE802154_UNSET_ACK \
115 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_UNSET_ACK)
116
118
124#define NET_REQUEST_IEEE802154_PASSIVE_SCAN \
125 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_PASSIVE_SCAN)
126
128
134#define NET_REQUEST_IEEE802154_ACTIVE_SCAN \
135 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_ACTIVE_SCAN)
136
138
140#define NET_REQUEST_IEEE802154_CANCEL_SCAN \
141 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_CANCEL_SCAN)
142
144
146#define NET_REQUEST_IEEE802154_ASSOCIATE \
147 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_ASSOCIATE)
148
150
152#define NET_REQUEST_IEEE802154_DISASSOCIATE \
153 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_DISASSOCIATE)
154
156
158#define NET_REQUEST_IEEE802154_SET_CHANNEL \
159 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_CHANNEL)
160
162
164#define NET_REQUEST_IEEE802154_GET_CHANNEL \
165 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_CHANNEL)
166
168
170#define NET_REQUEST_IEEE802154_SET_PAN_ID \
171 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_PAN_ID)
172
174
176#define NET_REQUEST_IEEE802154_GET_PAN_ID \
177 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_PAN_ID)
178
180
185#define NET_REQUEST_IEEE802154_SET_EXT_ADDR \
186 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_EXT_ADDR)
187
189
191#define NET_REQUEST_IEEE802154_GET_EXT_ADDR \
192 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_EXT_ADDR)
193
195
197#define NET_REQUEST_IEEE802154_SET_SHORT_ADDR \
198 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_SHORT_ADDR)
199
201
203#define NET_REQUEST_IEEE802154_GET_SHORT_ADDR \
204 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_SHORT_ADDR)
205
207
212#define NET_REQUEST_IEEE802154_GET_TX_POWER \
213 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_TX_POWER)
214
216
218#define NET_REQUEST_IEEE802154_SET_TX_POWER \
219 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_TX_POWER)
220
222
223#ifdef CONFIG_NET_L2_IEEE802154_SECURITY
224
231#define NET_REQUEST_IEEE802154_SET_SECURITY_SETTINGS \
232 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_SECURITY_SETTINGS)
233
235
241#define NET_REQUEST_IEEE802154_GET_SECURITY_SETTINGS \
242 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_SECURITY_SETTINGS)
243
245
246#endif /* CONFIG_NET_L2_IEEE802154_SECURITY */
247
256enum net_event_ieee802154_cmd {
257 NET_EVENT_IEEE802154_CMD_SCAN_RESULT = 1,
258};
259
282#define NET_EVENT_IEEE802154_SCAN_RESULT \
283 (_NET_IEEE802154_EVENT | NET_EVENT_IEEE802154_CMD_SCAN_RESULT)
284
293#define IEEE802154_IS_CHAN_SCANNED(_channel_set, _chan) \
294 (_channel_set & BIT(_chan - 1))
295#define IEEE802154_IS_CHAN_UNSCANNED(_channel_set, _chan) \
296 (!IEEE802154_IS_CHAN_SCANNED(_channel_set, _chan))
297
298#define IEEE802154_ALL_CHANNELS UINT32_MAX
299
312
315
317 uint16_t channel; /* in CPU byte order */
319 uint16_t pan_id; /* in CPU byte order */
320
322 union {
323 uint16_t short_addr; /* in CPU byte order */
325 };
326
331};
332
340 uint8_t key[16]; /* secKeyDescriptor.secKey */
341 uint8_t key_len; /* a key length of 16 bytes is mandatory for standards conformance */
342 uint8_t key_mode : 2; /* secKeyIdMode */
343 uint8_t level : 3; /* Used instead of a frame-specific SecurityLevel parameter when
344 * constructing the auxiliary security header
345 */
346 uint8_t _unused : 3;
347};
348
349#ifdef __cplusplus
350}
351#endif
352
357#endif /* ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_ */
#define IEEE802154_MAX_ADDR_LENGTH
IEEE 802.15.4 maximum address length.
Definition: ieee802154.h:143
#define NET_REQUEST_IEEE802154_ASSOCIATE
MLME-ASSOCIATE(...) request.
Definition: ieee802154_mgmt.h:146
#define NET_REQUEST_IEEE802154_GET_TX_POWER
MLME-SET(phyUnicastTxPower/phyBroadcastTxPower) request (currently not distinguished)
Definition: ieee802154_mgmt.h:212
#define NET_REQUEST_IEEE802154_GET_SECURITY_SETTINGS
Gets the configured sec* attributes.
Definition: ieee802154_mgmt.h:241
#define NET_REQUEST_IEEE802154_SET_TX_POWER
MLME-GET(phyUnicastTxPower/phyBroadcastTxPower) request.
Definition: ieee802154_mgmt.h:218
#define NET_REQUEST_IEEE802154_SET_CHANNEL
MLME-SET(phyCurrentChannel) request.
Definition: ieee802154_mgmt.h:158
#define NET_REQUEST_IEEE802154_GET_SHORT_ADDR
MLME-GET(macShortAddress) request.
Definition: ieee802154_mgmt.h:203
#define NET_REQUEST_IEEE802154_PASSIVE_SCAN
MLME-SCAN(PASSIVE, ...) request.
Definition: ieee802154_mgmt.h:124
#define NET_REQUEST_IEEE802154_GET_PAN_ID
MLME-GET(macPanId) request.
Definition: ieee802154_mgmt.h:176
#define NET_REQUEST_IEEE802154_SET_SECURITY_SETTINGS
Configures basic sec* MAC PIB attributes, implies macSecurityEnabled=true.
Definition: ieee802154_mgmt.h:231
#define NET_REQUEST_IEEE802154_SET_PAN_ID
MLME-SET(macPanId) request.
Definition: ieee802154_mgmt.h:170
#define NET_REQUEST_IEEE802154_SET_SHORT_ADDR
MLME-SET(macShortAddress) request, only allowed for co-ordinators.
Definition: ieee802154_mgmt.h:197
#define NET_REQUEST_IEEE802154_SET_ACK
Sets AckTx for all subsequent MLME-DATA (aka TX) requests.
Definition: ieee802154_mgmt.h:109
#define NET_REQUEST_IEEE802154_ACTIVE_SCAN
MLME-SCAN(ACTIVE, ...) request.
Definition: ieee802154_mgmt.h:134
#define NET_REQUEST_IEEE802154_DISASSOCIATE
MLME-DISASSOCIATE(...) request.
Definition: ieee802154_mgmt.h:152
#define NET_REQUEST_IEEE802154_GET_CHANNEL
MLME-GET(phyCurrentChannel) request.
Definition: ieee802154_mgmt.h:164
#define NET_REQUEST_IEEE802154_SET_EXT_ADDR
Sets the extended interface address (non-standard), see sections 7.1 and 8.4.3.1, in big endian byte ...
Definition: ieee802154_mgmt.h:185
#define NET_REQUEST_IEEE802154_CANCEL_SCAN
Cancels an ongoing MLME-SCAN(...) command (non-standard).
Definition: ieee802154_mgmt.h:140
#define NET_REQUEST_IEEE802154_GET_EXT_ADDR
like MLME-GET(macExtendedAddress) but in big endian byte order
Definition: ieee802154_mgmt.h:191
#define NET_REQUEST_IEEE802154_UNSET_ACK
Unsets AckTx for all subsequent MLME-DATA requests.
Definition: ieee802154_mgmt.h:114
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Definition: net_mgmt.h:95
IEEE 802.15.4 native L2 stack public header.
Network Management API public header.
__UINT32_TYPE__ uint32_t
Definition: stdint.h:90
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
__UINT16_TYPE__ uint16_t
Definition: stdint.h:89
Scanning parameters.
Definition: ieee802154_mgmt.h:309
uint32_t duration
Duration of scan, per-channel, in milliseconds.
Definition: ieee802154_mgmt.h:314
uint16_t channel
Current channel in use as a result.
Definition: ieee802154_mgmt.h:317
uint8_t len
length of address
Definition: ieee802154_mgmt.h:328
uint16_t short_addr
Definition: ieee802154_mgmt.h:323
uint16_t pan_id
Current pan_id in use as a result.
Definition: ieee802154_mgmt.h:319
uint32_t channel_set
The set of channels to scan, use above macros to manage it.
Definition: ieee802154_mgmt.h:311
uint8_t lqi
Link quality information, between 0 and 255.
Definition: ieee802154_mgmt.h:330
uint8_t addr[IEEE802154_MAX_ADDR_LENGTH]
Definition: ieee802154_mgmt.h:324
Security parameters.
Definition: ieee802154_mgmt.h:339
uint8_t key_len
Definition: ieee802154_mgmt.h:341
uint8_t level
Definition: ieee802154_mgmt.h:343
uint8_t key_mode
Definition: ieee802154_mgmt.h:342
uint8_t key[16]
Definition: ieee802154_mgmt.h:340