LoRaWAN header types and helper functions.
More...
LoRaWAN header types and helper functions.
|
file | hdr.h |
| LoRaWAN header type and helper function definitions.
|
|
◆ LORAWAN_HDR_ACK_MASK
#define LORAWAN_HDR_ACK_MASK (0x20) |
ACK bit mask.
Definition at line 40 of file hdr.h.
◆ LORAWAN_HDR_ACK_POS
#define LORAWAN_HDR_ACK_POS (5U) |
ACK bit position.
Definition at line 41 of file hdr.h.
◆ LORAWAN_HDR_ADR_ACK_MASK
#define LORAWAN_HDR_ADR_ACK_MASK (0x40) |
ADR ACK bit mask.
Definition at line 38 of file hdr.h.
◆ LORAWAN_HDR_ADR_ACK_POS
#define LORAWAN_HDR_ADR_ACK_POS (6U) |
ADR ACK bit position.
Definition at line 39 of file hdr.h.
◆ LORAWAN_HDR_ADR_MASK
#define LORAWAN_HDR_ADR_MASK (0x80) |
ADR mask.
Definition at line 36 of file hdr.h.
◆ LORAWAN_HDR_ADR_POS
#define LORAWAN_HDR_ADR_POS (7U) |
ADR position.
Definition at line 37 of file hdr.h.
◆ LORAWAN_HDR_FOPTS_LEN_MASK
#define LORAWAN_HDR_FOPTS_LEN_MASK (0x0F) |
Frame options mask.
Definition at line 44 of file hdr.h.
◆ LORAWAN_HDR_FOPTS_LEN_POS
#define LORAWAN_HDR_FOPTS_LEN_POS (0U) |
Frame options position.
Definition at line 45 of file hdr.h.
◆ LORAWAN_HDR_FRAME_PENDING_MASK
#define LORAWAN_HDR_FRAME_PENDING_MASK (0x10) |
Frame pending bit mask.
Definition at line 42 of file hdr.h.
◆ LORAWAN_HDR_FRAME_PENDING_POS
#define LORAWAN_HDR_FRAME_PENDING_POS (4U) |
Frame pending bit position.
Definition at line 43 of file hdr.h.
◆ LORAWAN_HDR_MAJOR_MASK
#define LORAWAN_HDR_MAJOR_MASK (0x03) |
Major version mask.
Definition at line 34 of file hdr.h.
◆ LORAWAN_HDR_MAJOR_POS
#define LORAWAN_HDR_MAJOR_POS (0U) |
Major version position.
Definition at line 35 of file hdr.h.
◆ LORAWAN_HDR_MTYPE_MASK
#define LORAWAN_HDR_MTYPE_MASK (0xe0) |
MType mask.
Definition at line 32 of file hdr.h.
◆ LORAWAN_HDR_MTYPE_POS
#define LORAWAN_HDR_MTYPE_POS (5U) |
MType position.
Definition at line 33 of file hdr.h.
◆ LORAWAN_JA_HDR_OPTNEG_MASK
#define LORAWAN_JA_HDR_OPTNEG_MASK (0x80) |
OptNeg bit mask.
Definition at line 47 of file hdr.h.
◆ LORAWAN_JA_HDR_OPTNEG_POS
#define LORAWAN_JA_HDR_OPTNEG_POS (7U) |
OptNeg bit position.
Definition at line 48 of file hdr.h.
◆ lorawan_hdr_get_ack()
Get LoRaWAN header ACK bit.
- Parameters
-
- Returns
- value of the ACK bit
Definition at line 231 of file hdr.h.
◆ lorawan_hdr_get_adr()
Get LoRaWAN header Adaptive Data Rate bit.
- Parameters
-
- Returns
- the value of the ADR bit
Definition at line 183 of file hdr.h.
◆ lorawan_hdr_get_adr_ack_req()
Get LoRaWAN header ADR ACK request bit.
- Parameters
-
- Returns
- the value of ADR ACK request bit
Definition at line 207 of file hdr.h.
◆ lorawan_hdr_get_frame_opts_len()
static uint8_t lorawan_hdr_get_frame_opts_len |
( |
lorawan_hdr_t * |
hdr | ) |
|
|
inlinestatic |
Get LoRaWAN header FOps length.
- Parameters
-
- Returns
- length of piggybacked FOpts
Definition at line 279 of file hdr.h.
◆ lorawan_hdr_get_frame_pending()
Get LoRaWAN header frame pending bit.
- Parameters
-
- Returns
- value of the frame pending bit
Definition at line 255 of file hdr.h.
◆ lorawan_hdr_get_maj()
Get LoRaWAN major version.
- Parameters
-
- Returns
- major version of the packet
Definition at line 159 of file hdr.h.
◆ lorawan_hdr_get_mtype()
Get LoRaWAN header MType.
- Parameters
-
- Returns
- mtype of the packet
Definition at line 135 of file hdr.h.
◆ lorawan_hdr_set_ack()
static void lorawan_hdr_set_ack |
( |
lorawan_hdr_t * |
hdr, |
|
|
bool |
ack |
|
) |
| |
|
inlinestatic |
Set LoRaWAN header ACK bit.
- Parameters
-
[in] | hdr | LoRaWAN header |
[in] | ack | value of the ACK bit |
Definition at line 218 of file hdr.h.
◆ lorawan_hdr_set_adr()
static void lorawan_hdr_set_adr |
( |
lorawan_hdr_t * |
hdr, |
|
|
bool |
adr |
|
) |
| |
|
inlinestatic |
Set LoRaWAN header Adaptive Data Rate bit.
- Parameters
-
[in] | hdr | LoRaWAN header |
[in] | adr | value of the ADR bit |
Definition at line 170 of file hdr.h.
◆ lorawan_hdr_set_adr_ack_req()
static void lorawan_hdr_set_adr_ack_req |
( |
lorawan_hdr_t * |
hdr, |
|
|
bool |
adr_ack_req |
|
) |
| |
|
inlinestatic |
Set LoRaWAN header ADR ACK request bit.
- Parameters
-
[in] | hdr | LoRaWAN header |
[in] | adr_ack_req | value of the ADR ACK request bit |
Definition at line 194 of file hdr.h.
◆ lorawan_hdr_set_frame_opts_len()
static void lorawan_hdr_set_frame_opts_len |
( |
lorawan_hdr_t * |
hdr, |
|
|
uint8_t |
len |
|
) |
| |
|
inlinestatic |
Set LoRaWAN header FOpts length.
- Parameters
-
[in] | hdr | LoRaWAN header |
[in] | len | length of the piggybacked FOpts |
Definition at line 266 of file hdr.h.
◆ lorawan_hdr_set_frame_pending()
static void lorawan_hdr_set_frame_pending |
( |
lorawan_hdr_t * |
hdr, |
|
|
bool |
frame_pending |
|
) |
| |
|
inlinestatic |
Set LoRaWAN header frame pending bit.
- Parameters
-
[in] | hdr | LoRaWAN header |
[in] | frame_pending | value of the frame pending bit |
Definition at line 242 of file hdr.h.
◆ lorawan_hdr_set_maj()
static void lorawan_hdr_set_maj |
( |
lorawan_hdr_t * |
hdr, |
|
|
uint8_t |
maj |
|
) |
| |
|
inlinestatic |
Set LoRaWAN major version.
- Parameters
-
[in] | hdr | LoRaWAN header |
[in] | maj | major version |
Definition at line 146 of file hdr.h.
◆ lorawan_hdr_set_mtype()
static void lorawan_hdr_set_mtype |
( |
lorawan_hdr_t * |
hdr, |
|
|
uint8_t |
mtype |
|
) |
| |
|
inlinestatic |
Set LoRaWAN header MType.
- Parameters
-
[in] | hdr | LoRaWAN hdr |
[in] | mtype | desired MType |
Definition at line 122 of file hdr.h.
◆ lorawan_ja_hdr_get_optneg()
Get LoRaWAN join accept message OptNeg bit.
- Parameters
-
[in] | ja_hdr | Join accept message header |
- Returns
- value of the OptNeg bit
Definition at line 291 of file hdr.h.