Go to the documentation of this file.
22 #ifndef NET_LORAWAN_HDR_H
23 #define NET_LORAWAN_HDR_H
32 #define LORAWAN_HDR_MTYPE_MASK (0xe0)
33 #define LORAWAN_HDR_MTYPE_POS (5U)
34 #define LORAWAN_HDR_MAJOR_MASK (0x03)
35 #define LORAWAN_HDR_MAJOR_POS (0U)
36 #define LORAWAN_HDR_ADR_MASK (0x80)
37 #define LORAWAN_HDR_ADR_POS (7U)
38 #define LORAWAN_HDR_ADR_ACK_MASK (0x40)
39 #define LORAWAN_HDR_ADR_ACK_POS (6U)
40 #define LORAWAN_HDR_ACK_MASK (0x20)
41 #define LORAWAN_HDR_ACK_POS (5U)
42 #define LORAWAN_HDR_FRAME_PENDING_MASK (0x10)
43 #define LORAWAN_HDR_FRAME_PENDING_POS (4U)
44 #define LORAWAN_HDR_FOPTS_LEN_MASK (0x0F)
45 #define LORAWAN_HDR_FOPTS_LEN_POS (0U)
71 typedef struct __attribute__((packed)) {
93 typedef struct __attribute__((packed)) {
104 typedef struct __attribute__((packed)) {
A 32 bit integer in little endian.
#define LORAMAC_DEVADDR_LEN
Device address length in bytes.
le_uint64_t dev_eui
device EUI
static void lorawan_hdr_set_frame_pending(lorawan_hdr_t *hdr, bool frame_pending)
Set LoRaWAN header frame pending bit.
#define LORAWAN_HDR_ACK_MASK
ACK bit mask.
le_uint16_t dev_nonce
device nonce
A 16 bit integer in little endian.
#define LORAWAN_HDR_ADR_POS
ADR position.
Functions to work with different byte orders.
uint8_t fctrl
frame control
le_uint32_t mic
message integrity code
LoRaMAC header definitions.
Join request packet representation.
uint8_t mt_maj
mtype and major version holder
#define LORAWAN_HDR_MAJOR_MASK
Major version mask.
#define LORAWAN_HDR_ADR_MASK
ADR mask.
#define LORAMAC_APP_NONCE_LEN
Application Nonce length in bytes.
static bool lorawan_hdr_get_adr_ack_req(lorawan_hdr_t *hdr)
Get LoRaWAN header ADR ACK request bit.
uint8_t mt_maj
message type and major version
#define LORAWAN_HDR_FOPTS_LEN_POS
Frame options position.
static uint8_t lorawan_hdr_get_frame_opts_len(lorawan_hdr_t *hdr)
Get LoRaWAN header FOps length.
static bool lorawan_hdr_get_frame_pending(lorawan_hdr_t *hdr)
Get LoRaWAN header frame pending bit.
static bool lorawan_hdr_get_adr(lorawan_hdr_t *hdr)
Get LoRaWAN header Adaptive Data Rate bit.
Join accept packet representation.
le_uint64_t app_eui
application EUI
Data type to represent a LoRaWAN packet header.
#define LORAWAN_HDR_ADR_ACK_MASK
ADR ACK bit mask.
static void lorawan_hdr_set_ack(lorawan_hdr_t *hdr, bool ack)
Set LoRaWAN header ACK bit.
#define LORAWAN_HDR_FRAME_PENDING_MASK
Frame pending bit mask.
le_uint16_t fcnt
frame counter
#define LORAWAN_HDR_FRAME_PENDING_POS
Frame pending bit position.
#define LORAWAN_HDR_MTYPE_POS
MType position.
#define LORAWAN_HDR_MTYPE_MASK
MType mask.
le_uint32_t addr
32 bit LoRaWAN address
#define LORAWAN_HDR_ADR_ACK_POS
ADR ACK bit position.
uint8_t mt_maj
mtype and major version holder
#define LORAWAN_HDR_ACK_POS
ACK bit position.
#define LORAMAC_NETWORK_ID_LEN
Network ID length in bytes.
#define LORAWAN_HDR_MAJOR_POS
Major version position.
static void lorawan_hdr_set_adr(lorawan_hdr_t *hdr, bool adr)
Set LoRaWAN header Adaptive Data Rate bit.
static bool lorawan_hdr_get_ack(lorawan_hdr_t *hdr)
Get LoRaWAN header ACK bit.
uint8_t dl_settings
downlink settings
A 64 bit integer in little endian.
uint8_t rx_delay
first reception window delay
static void lorawan_hdr_set_maj(lorawan_hdr_t *hdr, uint8_t maj)
Set LoRaWAN major version.
static void lorawan_hdr_set_adr_ack_req(lorawan_hdr_t *hdr, bool adr_ack_req)
Set LoRaWAN header ADR ACK request bit.
static void lorawan_hdr_set_frame_opts_len(lorawan_hdr_t *hdr, uint8_t len)
Set LoRaWAN header FOpts length.
#define LORAWAN_HDR_FOPTS_LEN_MASK
Frame options mask.
static uint8_t lorawan_hdr_get_mtype(lorawan_hdr_t *hdr)
Get LoRaWAN header MType.
static uint8_t lorawan_hdr_get_maj(lorawan_hdr_t *hdr)
Get LoRaWAN major version.
static void lorawan_hdr_set_mtype(lorawan_hdr_t *hdr, uint8_t mtype)
Set LoRaWAN header MType.