35 #define IEEE802154_SFD (0xa7)
41 #define IEEE802154_SHORT_ADDRESS_LEN (2U)
42 #define IEEE802154_LONG_ADDRESS_LEN (8U)
51 #define IEEE802154_MAX_HDR_LEN (23U)
52 #define IEEE802154_MIN_FRAME_LEN (IEEE802154_FCF_LEN + sizeof(uint8_t))
54 #define IEEE802154_FCF_LEN (2U)
55 #define IEEE802154_FCS_LEN (2U)
57 #define IEEE802154_FCF_TYPE_MASK (0x07)
58 #define IEEE802154_FCF_TYPE_BEACON (0x00)
59 #define IEEE802154_FCF_TYPE_DATA (0x01)
60 #define IEEE802154_FCF_TYPE_ACK (0x02)
61 #define IEEE802154_FCF_TYPE_MACCMD (0x03)
63 #define IEEE802154_FCF_SECURITY_EN (0x08)
64 #define IEEE802154_FCF_FRAME_PEND (0x10)
65 #define IEEE802154_FCF_ACK_REQ (0x20)
66 #define IEEE802154_FCF_PAN_COMP (0x40)
68 #define IEEE802154_FCF_DST_ADDR_MASK (0x0c)
69 #define IEEE802154_FCF_DST_ADDR_VOID (0x00)
70 #define IEEE802154_FCF_DST_ADDR_RESV (0x04)
71 #define IEEE802154_FCF_DST_ADDR_SHORT (0x08)
72 #define IEEE802154_FCF_DST_ADDR_LONG (0x0c)
74 #define IEEE802154_FCF_VERS_MASK (0x30)
75 #define IEEE802154_FCF_VERS_V0 (0x00)
76 #define IEEE802154_FCF_VERS_V1 (0x10)
78 #define IEEE802154_FCF_SRC_ADDR_MASK (0xc0)
79 #define IEEE802154_FCF_SRC_ADDR_VOID (0x00)
80 #define IEEE802154_FCF_SRC_ADDR_RESV (0x40)
81 #define IEEE802154_FCF_SRC_ADDR_SHORT (0x80)
82 #define IEEE802154_FCF_SRC_ADDR_LONG (0xc0)
89 #define IEEE802154_CHANNEL_MIN_SUBGHZ (0U)
90 #define IEEE802154_CHANNEL_MAX_SUBGHZ (10U)
91 #define IEEE802154_CHANNEL_MIN (11U)
92 #define IEEE802154_CHANNEL_MAX (26U)
95 #define IEEE802154_FRAME_LEN_MAX (127U)
96 #define IEEE802154G_FRAME_LEN_MAX (2047U)
97 #define IEEE802154_ACK_FRAME_LEN (5U)
102 #define IEEE802154_LIFS_SYMS (40U)
107 #define IEEE802154_SIFS_SYMS (12U)
112 #define IEEE802154_SIFS_MAX_FRAME_SIZE (18U)
117 #define IEEE802154_ACK_TIMEOUT_SYMS (54)
122 #define IEEE802154_MR_OFDM_SYMBOL_TIME_US (120)
129 #define IEEE802154_MR_FSK_SYMBOL_TIME_US (20)
136 #define IEEE802154_RADIO_RSSI_OFFSET (-174)
138 #define IEEE802154_PHY_MR_FSK_PHR_LEN (2)
139 #define IEEE802154_PHY_MR_FSK_2FSK_SFD_LEN (2)
149 #define IEEE802154_PHY_MR_FSK_2FSK_CODED_SFD_0 (0x6F4E)
150 #define IEEE802154_PHY_MR_FSK_2FSK_CODED_SFD_1 (0x632D)
151 #define IEEE802154_PHY_MR_FSK_2FSK_UNCODED_SFD_0 (0x90E4)
152 #define IEEE802154_PHY_MR_FSK_2FSK_UNCODED_SFD_1 (0x7A0E)
161 #define IEEE802154G_ATURNAROUNDTIME_US (1 * US_PER_MS)
167 #define IEEE802154_ATURNAROUNDTIME_IN_SYMBOLS (12)
178 #define IEEE802154_SYMBOL_TIME_US (16)
187 #define IEEE802154_CCA_DURATION_IN_SYMBOLS (8)
268 #define IEEE802154_ADDR_BCAST { 0xff, 0xff }
273 #define IEEE802154_ADDR_BCAST_LEN (IEEE802154_SHORT_ADDRESS_LEN)
290 #if IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_BPSK)
291 #define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_BPSK
292 #elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_ASK)
293 #define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_ASK
294 #elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_OQPSK)
295 #define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_OQPSK
296 #elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_MR_OQPSK)
297 #define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_MR_OQPSK
298 #elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_MR_OFDM)
299 #define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_MR_OFDM
300 #elif IS_ACTIVE(CONFIG_IEEE802154_DEFAULT_PHY_MR_FSK)
301 #define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_MR_FSK
304 #ifndef CONFIG_IEEE802154_DEFAULT_PHY_MODE
305 #define CONFIG_IEEE802154_DEFAULT_PHY_MODE IEEE802154_PHY_OQPSK
311 #ifndef CONFIG_IEEE802154_DEFAULT_SUBGHZ_CHANNEL
312 #define CONFIG_IEEE802154_DEFAULT_SUBGHZ_CHANNEL (5U)
318 #ifndef CONFIG_IEEE802154_DEFAULT_CHANNEL
319 #define CONFIG_IEEE802154_DEFAULT_CHANNEL (26U)
325 #ifndef CONFIG_IEEE802154_DEFAULT_SUBGHZ_PAGE
326 #define CONFIG_IEEE802154_DEFAULT_SUBGHZ_PAGE (2U)
332 #ifndef CONFIG_IEEE802154_MR_OQPSK_DEFAULT_CHIPS
333 #define CONFIG_IEEE802154_MR_OQPSK_DEFAULT_CHIPS IEEE802154_MR_OQPSK_CHIPS_1000
339 #ifndef CONFIG_IEEE802154_MR_OQPSK_DEFAULT_RATE
340 #define CONFIG_IEEE802154_MR_OQPSK_DEFAULT_RATE (2U)
346 #ifndef CONFIG_IEEE802154_MR_OFDM_DEFAULT_OPTION
347 #define CONFIG_IEEE802154_MR_OFDM_DEFAULT_OPTION (2U)
353 #ifndef CONFIG_IEEE802154_MR_OFDM_DEFAULT_SCHEME
354 #define CONFIG_IEEE802154_MR_OFDM_DEFAULT_SCHEME (2U)
360 #ifndef CONFIG_IEEE802154_MR_FSK_DEFAULT_SRATE
361 #define CONFIG_IEEE802154_MR_FSK_DEFAULT_SRATE IEEE802154_MR_FSK_SRATE_200K
367 #ifndef CONFIG_IEEE802154_MR_FSK_DEFAULT_MOD_IDX
368 #define CONFIG_IEEE802154_MR_FSK_DEFAULT_MOD_IDX (64U)
374 #ifndef CONFIG_IEEE802154_MR_FSK_DEFAULT_MOD_ORD
375 #define CONFIG_IEEE802154_MR_FSK_DEFAULT_MOD_ORD (2U)
381 #ifndef CONFIG_IEEE802154_MR_FSK_DEFAULT_FEC
382 #define CONFIG_IEEE802154_MR_FSK_DEFAULT_FEC IEEE802154_FEC_NONE
388 #ifndef CONFIG_IEEE802154_DEFAULT_PANID
389 #define CONFIG_IEEE802154_DEFAULT_PANID (0x0023U)
395 #ifndef IEEE802154_PANID_BCAST
396 #define IEEE802154_PANID_BCAST { 0xff, 0xff }
402 #ifndef CONFIG_IEEE802154_DEFAULT_TXPOWER
403 #define CONFIG_IEEE802154_DEFAULT_TXPOWER (0)
410 #ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_MIN_BE
411 #define CONFIG_IEEE802154_DEFAULT_CSMA_CA_MIN_BE (3U)
417 #ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_RETRIES
418 #define CONFIG_IEEE802154_DEFAULT_CSMA_CA_RETRIES (4U)
424 #ifndef CONFIG_IEEE802154_DEFAULT_CSMA_CA_MAX_BE
425 #define CONFIG_IEEE802154_DEFAULT_CSMA_CA_MAX_BE (5U)
431 #ifndef CONFIG_IEEE802154_CCA_THRESH_DEFAULT
432 #define CONFIG_IEEE802154_CCA_THRESH_DEFAULT (-70)
438 #ifndef CONFIG_IEEE802154_DEFAULT_MAX_FRAME_RETRANS
439 #define CONFIG_IEEE802154_DEFAULT_MAX_FRAME_RETRANS (4U)
446 #define CONFIG_IEEE802154_AUTO_ACK_DISABLE 0
452 #ifndef CONFIG_IEEE802154_DEFAULT_ACK_REQ
453 #define CONFIG_IEEE802154_DEFAULT_ACK_REQ 1
461 #ifndef CONFIG_IEEE802154_DSME_CAP_REDUCTION
462 #define CONFIG_IEEE802154_DSME_CAP_REDUCTION 0
474 #ifndef CONFIG_IEEE802154_DSME_MAC_RESPONSE_WAIT_TIME
475 #define CONFIG_IEEE802154_DSME_MAC_RESPONSE_WAIT_TIME (244U)
486 #ifndef CONFIG_IEEE802154_DSME_SCAN_DURATION
487 #define CONFIG_IEEE802154_DSME_SCAN_DURATION (4U)
501 #ifndef CONFIG_IEEE802154_DSME_SUPERFRAME_ORDER
502 #define CONFIG_IEEE802154_DSME_SUPERFRAME_ORDER (3U)
514 #ifndef CONFIG_IEEE802154_DSME_MULTISUPERFRAME_ORDER
515 #define CONFIG_IEEE802154_DSME_MULTISUPERFRAME_ORDER (3U)
527 #ifndef CONFIG_IEEE802154_DSME_BEACON_ORDER
528 #define CONFIG_IEEE802154_DSME_BEACON_ORDER (3U)
542 #define CONFIG_IEEE802154_DSME_STATIC_GTS 0
553 #ifndef CONFIG_IEEE802154_DSME_GTS_EXPIRATION
554 #define CONFIG_IEEE802154_DSME_GTS_EXPIRATION (16U)
562 #ifndef CONFIG_IEEE802154_DSME_MIN_COORD_LQI
563 #define CONFIG_IEEE802154_DSME_MIN_COORD_LQI (100U)
610 const uint8_t *dst,
size_t dst_len,
612 uint8_t flags, uint8_t seq);
715 eui64->
uint8[0] = addr[i++] ^ 0x02;
716 eui64->
uint8[1] = addr[i++];
717 eui64->
uint8[2] = addr[i++];
718 eui64->
uint8[3] = addr[i++];
719 eui64->
uint8[4] = addr[i++];
720 eui64->
uint8[5] = addr[i++];
721 eui64->
uint8[6] = addr[i++];
722 eui64->
uint8[7] = addr[i++];
726 eui64->
uint8[0] = addr[i++] ^ 0x02;
727 eui64->
uint8[1] = addr[i++];
732 eui64->
uint8[3] = 0xff;
733 eui64->
uint8[4] = 0xfe;
735 eui64->
uint8[6] = addr[i++];
736 eui64->
uint8[7] = addr[i++];
783 const int max = min + (UINT8_MAX - 1);
785 int val = dbm <= min ? min : (dbm >= max ? max : dbm);
Functions to work with different byte orders.
EUI-64 data type definition.
Common macros and compiler attributes/pragmas configuration.
Utility header providing time unit defines.
A 16 bit integer in big endian aka network byte order.
Data type to represent an EUI-64.
uint8_t uint8[8]
split into 8 8-bit words.
A 16 bit integer in little endian.