14#ifndef ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_
15#define ZEPHYR_INCLUDE_NET_IEEE802154_MGMT_H_
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)
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,
109#define NET_REQUEST_IEEE802154_SET_ACK (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_ACK)
114#define NET_REQUEST_IEEE802154_UNSET_ACK \
115 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_UNSET_ACK)
124#define NET_REQUEST_IEEE802154_PASSIVE_SCAN \
125 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_PASSIVE_SCAN)
134#define NET_REQUEST_IEEE802154_ACTIVE_SCAN \
135 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_ACTIVE_SCAN)
140#define NET_REQUEST_IEEE802154_CANCEL_SCAN \
141 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_CANCEL_SCAN)
146#define NET_REQUEST_IEEE802154_ASSOCIATE \
147 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_ASSOCIATE)
152#define NET_REQUEST_IEEE802154_DISASSOCIATE \
153 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_DISASSOCIATE)
158#define NET_REQUEST_IEEE802154_SET_CHANNEL \
159 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_CHANNEL)
164#define NET_REQUEST_IEEE802154_GET_CHANNEL \
165 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_CHANNEL)
170#define NET_REQUEST_IEEE802154_SET_PAN_ID \
171 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_PAN_ID)
176#define NET_REQUEST_IEEE802154_GET_PAN_ID \
177 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_PAN_ID)
185#define NET_REQUEST_IEEE802154_SET_EXT_ADDR \
186 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_EXT_ADDR)
191#define NET_REQUEST_IEEE802154_GET_EXT_ADDR \
192 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_EXT_ADDR)
197#define NET_REQUEST_IEEE802154_SET_SHORT_ADDR \
198 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_SHORT_ADDR)
203#define NET_REQUEST_IEEE802154_GET_SHORT_ADDR \
204 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_SHORT_ADDR)
212#define NET_REQUEST_IEEE802154_GET_TX_POWER \
213 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_TX_POWER)
218#define NET_REQUEST_IEEE802154_SET_TX_POWER \
219 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_TX_POWER)
223#ifdef CONFIG_NET_L2_IEEE802154_SECURITY
231#define NET_REQUEST_IEEE802154_SET_SECURITY_SETTINGS \
232 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_SET_SECURITY_SETTINGS)
241#define NET_REQUEST_IEEE802154_GET_SECURITY_SETTINGS \
242 (_NET_IEEE802154_BASE | NET_REQUEST_IEEE802154_CMD_GET_SECURITY_SETTINGS)
256enum net_event_ieee802154_cmd {
257 NET_EVENT_IEEE802154_CMD_SCAN_RESULT = 1,
282#define NET_EVENT_IEEE802154_SCAN_RESULT \
283 (_NET_IEEE802154_EVENT | NET_EVENT_IEEE802154_CMD_SCAN_RESULT)
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))
298#define IEEE802154_ALL_CHANNELS UINT32_MAX
#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