Zephyr API Documentation 3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
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
48#define _NET_IEEE802154_LAYER NET_MGMT_LAYER_L2
49#define _NET_IEEE802154_CODE 0x154
50#define _NET_IEEE802154_BASE (NET_MGMT_IFACE_BIT | \
51 NET_MGMT_LAYER(_NET_IEEE802154_LAYER) |\
52 NET_MGMT_LAYER_CODE(_NET_IEEE802154_CODE))
53#define _NET_IEEE802154_EVENT (_NET_IEEE802154_BASE | NET_MGMT_EVENT_BIT)
54
55enum net_request_ieee802154_cmd {
56 NET_REQUEST_IEEE802154_CMD_SET_ACK = 1,
57 NET_REQUEST_IEEE802154_CMD_UNSET_ACK,
58 NET_REQUEST_IEEE802154_CMD_PASSIVE_SCAN,
59 NET_REQUEST_IEEE802154_CMD_ACTIVE_SCAN,
60 NET_REQUEST_IEEE802154_CMD_CANCEL_SCAN,
61 NET_REQUEST_IEEE802154_CMD_ASSOCIATE,
62 NET_REQUEST_IEEE802154_CMD_DISASSOCIATE,
63 NET_REQUEST_IEEE802154_CMD_SET_CHANNEL,
64 NET_REQUEST_IEEE802154_CMD_GET_CHANNEL,
65 NET_REQUEST_IEEE802154_CMD_SET_PAN_ID,
66 NET_REQUEST_IEEE802154_CMD_GET_PAN_ID,
67 NET_REQUEST_IEEE802154_CMD_SET_EXT_ADDR,
68 NET_REQUEST_IEEE802154_CMD_GET_EXT_ADDR,
69 NET_REQUEST_IEEE802154_CMD_SET_SHORT_ADDR,
70 NET_REQUEST_IEEE802154_CMD_GET_SHORT_ADDR,
71 NET_REQUEST_IEEE802154_CMD_GET_TX_POWER,
72 NET_REQUEST_IEEE802154_CMD_SET_TX_POWER,
73 NET_REQUEST_IEEE802154_CMD_SET_SECURITY_SETTINGS,
74 NET_REQUEST_IEEE802154_CMD_GET_SECURITY_SETTINGS,
75};
76
111#define NET_REQUEST_IEEE802154_SET_ACK (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_ACK)
112
114
116#define NET_REQUEST_IEEE802154_UNSET_ACK \
117 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_UNSET_ACK)
118
120
126#define NET_REQUEST_IEEE802154_PASSIVE_SCAN \
127 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_PASSIVE_SCAN)
128
130
136#define NET_REQUEST_IEEE802154_ACTIVE_SCAN \
137 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_ACTIVE_SCAN)
138
140
142#define NET_REQUEST_IEEE802154_CANCEL_SCAN \
143 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_CANCEL_SCAN)
144
146
148#define NET_REQUEST_IEEE802154_ASSOCIATE \
149 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_ASSOCIATE)
150
152
154#define NET_REQUEST_IEEE802154_DISASSOCIATE \
155 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_DISASSOCIATE)
156
158
160#define NET_REQUEST_IEEE802154_SET_CHANNEL \
161 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_CHANNEL)
162
164
166#define NET_REQUEST_IEEE802154_GET_CHANNEL \
167 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_CHANNEL)
168
170
172#define NET_REQUEST_IEEE802154_SET_PAN_ID \
173 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_PAN_ID)
174
176
178#define NET_REQUEST_IEEE802154_GET_PAN_ID \
179 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_PAN_ID)
180
182
187#define NET_REQUEST_IEEE802154_SET_EXT_ADDR \
188 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_EXT_ADDR)
189
191
193#define NET_REQUEST_IEEE802154_GET_EXT_ADDR \
194 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_EXT_ADDR)
195
197
199#define NET_REQUEST_IEEE802154_SET_SHORT_ADDR \
200 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_SHORT_ADDR)
201
203
205#define NET_REQUEST_IEEE802154_GET_SHORT_ADDR \
206 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_SHORT_ADDR)
207
209
214#define NET_REQUEST_IEEE802154_GET_TX_POWER \
215 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_TX_POWER)
216
218
220#define NET_REQUEST_IEEE802154_SET_TX_POWER \
221 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_TX_POWER)
222
224
225#ifdef CONFIG_NET_L2_IEEE802154_SECURITY
226
233#define NET_REQUEST_IEEE802154_SET_SECURITY_SETTINGS \
234 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_SECURITY_SETTINGS)
235
237
243#define NET_REQUEST_IEEE802154_GET_SECURITY_SETTINGS \
244 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_SECURITY_SETTINGS)
245
247
248#endif /* CONFIG_NET_L2_IEEE802154_SECURITY */
249
258enum net_event_ieee802154_cmd {
259 NET_EVENT_IEEE802154_CMD_SCAN_RESULT = 1,
260};
261
284#define NET_EVENT_IEEE802154_SCAN_RESULT \
285 (_NET_IEEE802154_EVENT | NET_EVENT_IEEE802154_CMD_SCAN_RESULT)
286
295#define IEEE802154_IS_CHAN_SCANNED(_channel_set, _chan) \
296 (_channel_set & BIT(_chan - 1))
297#define IEEE802154_IS_CHAN_UNSCANNED(_channel_set, _chan) \
298 (!IEEE802154_IS_CHAN_SCANNED(_channel_set, _chan))
299
300#define IEEE802154_ALL_CHANNELS UINT32_MAX
301
341
357
358#ifdef __cplusplus
359}
360#endif
361
366#endif /* ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_ */
#define IEEE802154_MAX_ADDR_LENGTH
IEEE 802.15.4 maximum address length.
Definition ieee802154.h:147
#define NET_REQUEST_IEEE802154_ASSOCIATE
MLME-ASSOCIATE(...) request.
Definition ieee802154_mgmt.h:148
#define NET_REQUEST_IEEE802154_GET_TX_POWER
MLME-SET(phyUnicastTxPower/phyBroadcastTxPower) request (currently not distinguished)
Definition ieee802154_mgmt.h:214
#define NET_REQUEST_IEEE802154_GET_SECURITY_SETTINGS
Gets the configured sec* attributes.
Definition ieee802154_mgmt.h:243
#define NET_REQUEST_IEEE802154_SET_TX_POWER
MLME-GET(phyUnicastTxPower/phyBroadcastTxPower) request.
Definition ieee802154_mgmt.h:220
#define NET_REQUEST_IEEE802154_SET_CHANNEL
MLME-SET(phyCurrentChannel) request.
Definition ieee802154_mgmt.h:160
#define NET_REQUEST_IEEE802154_GET_SHORT_ADDR
MLME-GET(macShortAddress) request.
Definition ieee802154_mgmt.h:205
#define NET_REQUEST_IEEE802154_PASSIVE_SCAN
MLME-SCAN(PASSIVE, ...) request.
Definition ieee802154_mgmt.h:126
#define NET_REQUEST_IEEE802154_GET_PAN_ID
MLME-GET(macPanId) request.
Definition ieee802154_mgmt.h:178
#define NET_REQUEST_IEEE802154_SET_SECURITY_SETTINGS
Configures basic sec* MAC PIB attributes, implies macSecurityEnabled=true.
Definition ieee802154_mgmt.h:233
#define NET_REQUEST_IEEE802154_SET_PAN_ID
MLME-SET(macPanId) request.
Definition ieee802154_mgmt.h:172
#define NET_REQUEST_IEEE802154_SET_SHORT_ADDR
MLME-SET(macShortAddress) request, only allowed for co-ordinators.
Definition ieee802154_mgmt.h:199
#define NET_REQUEST_IEEE802154_SET_ACK
Sets AckTx for all subsequent MLME-DATA (aka TX) requests.
Definition ieee802154_mgmt.h:111
#define NET_REQUEST_IEEE802154_ACTIVE_SCAN
MLME-SCAN(ACTIVE, ...) request.
Definition ieee802154_mgmt.h:136
#define NET_REQUEST_IEEE802154_DISASSOCIATE
MLME-DISASSOCIATE(...) request.
Definition ieee802154_mgmt.h:154
#define NET_REQUEST_IEEE802154_GET_CHANNEL
MLME-GET(phyCurrentChannel) request.
Definition ieee802154_mgmt.h:166
#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:187
#define NET_REQUEST_IEEE802154_CANCEL_SCAN
Cancels an ongoing MLME-SCAN(...) command (non-standard).
Definition ieee802154_mgmt.h:142
#define NET_REQUEST_IEEE802154_GET_EXT_ADDR
like MLME-GET(macExtendedAddress) but in big endian byte order
Definition ieee802154_mgmt.h:193
#define NET_REQUEST_IEEE802154_UNSET_ACK
Unsets AckTx for all subsequent MLME-DATA requests.
Definition ieee802154_mgmt.h:116
#define NET_MGMT_DEFINE_REQUEST_HANDLER(_mgmt_request)
Declare a request handler function for the given network event.
Definition net_mgmt.h:111
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:311
size_t beacon_payload_len
Length of the additional payload.
Definition ieee802154_mgmt.h:339
uint8_t * beacon_payload
Additional payload of the beacon if any.
Definition ieee802154_mgmt.h:337
uint32_t duration
Duration of scan, per-channel, in milliseconds.
Definition ieee802154_mgmt.h:316
uint16_t channel
Current channel in use as a result.
Definition ieee802154_mgmt.h:319
uint8_t len
length of address
Definition ieee802154_mgmt.h:330
uint16_t short_addr
in CPU byte order
Definition ieee802154_mgmt.h:325
uint8_t addr[8]
in big endian
Definition ieee802154_mgmt.h:326
uint16_t pan_id
Current pan_id in use as a result.
Definition ieee802154_mgmt.h:321
uint32_t channel_set
The set of channels to scan, use above macros to manage it.
Definition ieee802154_mgmt.h:313
uint8_t lqi
Link quality information, between 0 and 255.
Definition ieee802154_mgmt.h:332
bool association_permitted
Flag if association is permitted by the coordinator.
Definition ieee802154_mgmt.h:334
Security parameters.
Definition ieee802154_mgmt.h:348
uint8_t key_len
Key length of 16 bytes is mandatory for standards conformance.
Definition ieee802154_mgmt.h:350
uint8_t level
Used instead of a frame-specific SecurityLevel parameter when constructing the auxiliary security hea...
Definition ieee802154_mgmt.h:352
uint8_t key_mode
secKeyIdMode
Definition ieee802154_mgmt.h:351
uint8_t key[16]
secKeyDescriptor.secKey
Definition ieee802154_mgmt.h:349