[LoRaWAN] Shorten LORAWAN to LW

This commit is contained in:
StevenCellist 2024-05-03 22:58:11 +02:00
parent 639ff00109
commit 43adfee174
4 changed files with 909 additions and 909 deletions

View file

@ -111,8 +111,8 @@ void loop() {
// and also request the LinkCheck and DeviceTime MAC commands
if(fcntUp % 64 == 0) {
Serial.println(F("[LoRaWAN] Requesting LinkCheck and DeviceTime"));
node.sendMacCommandReq(RADIOLIB_LORAWAN_MAC_LINK_CHECK);
node.sendMacCommandReq(RADIOLIB_LORAWAN_MAC_DEVICE_TIME);
node.sendMacCommandReq(RADIOLIB_LW_MAC_LINK_CHECK);
node.sendMacCommandReq(RADIOLIB_LW_MAC_DEVICE_TIME);
state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload), Port, downlinkPayload, &downlinkSize, true, &uplinkDetails, &downlinkDetails);
} else {
state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload), Port, downlinkPayload, &downlinkSize);

File diff suppressed because it is too large Load diff

View file

@ -1,200 +1,200 @@
#if !defined(_RADIOLIB_LORAWAN_H) && !RADIOLIB_EXCLUDE_LORAWAN
#define _RADIOLIB_LORAWAN_H
#if !defined(_RADIOLIB_LW_H) && !RADIOLIB_EXCLUDE_LORAWAN
#define _RADIOLIB_LW_H
#include "../../TypeDef.h"
#include "../PhysicalLayer/PhysicalLayer.h"
#include "../../utils/Cryptography.h"
// activation mode
#define RADIOLIB_LORAWAN_MODE_OTAA (0x07AA)
#define RADIOLIB_LORAWAN_MODE_ABP (0x0AB9)
#define RADIOLIB_LORAWAN_MODE_NONE (0x0000)
#define RADIOLIB_LW_MODE_OTAA (0x07AA)
#define RADIOLIB_LW_MODE_ABP (0x0AB9)
#define RADIOLIB_LW_MODE_NONE (0x0000)
// operation mode
#define RADIOLIB_LORAWAN_CLASS_A (0x0A)
#define RADIOLIB_LORAWAN_CLASS_B (0x0B)
#define RADIOLIB_LORAWAN_CLASS_C (0x0C)
#define RADIOLIB_LW_CLASS_A (0x0A)
#define RADIOLIB_LW_CLASS_B (0x0B)
#define RADIOLIB_LW_CLASS_C (0x0C)
// preamble format
#define RADIOLIB_LORAWAN_LORA_SYNC_WORD (0x34)
#define RADIOLIB_LORAWAN_LORA_PREAMBLE_LEN (8)
#define RADIOLIB_LORAWAN_GFSK_SYNC_WORD (0xC194C1)
#define RADIOLIB_LORAWAN_GFSK_PREAMBLE_LEN (5)
#define RADIOLIB_LW_LORA_SYNC_WORD (0x34)
#define RADIOLIB_LW_LORA_PREAMBLE_LEN (8)
#define RADIOLIB_LW_GFSK_SYNC_WORD (0xC194C1)
#define RADIOLIB_LW_GFSK_PREAMBLE_LEN (5)
// MAC header field encoding MSB LSB DESCRIPTION
#define RADIOLIB_LORAWAN_MHDR_MTYPE_JOIN_REQUEST (0x00 << 5) // 7 5 message type: join request
#define RADIOLIB_LORAWAN_MHDR_MTYPE_JOIN_ACCEPT (0x01 << 5) // 7 5 join accept
#define RADIOLIB_LORAWAN_MHDR_MTYPE_UNCONF_DATA_UP (0x02 << 5) // 7 5 unconfirmed data up
#define RADIOLIB_LORAWAN_MHDR_MTYPE_UNCONF_DATA_DOWN (0x03 << 5) // 7 5 unconfirmed data down
#define RADIOLIB_LORAWAN_MHDR_MTYPE_CONF_DATA_UP (0x04 << 5) // 7 5 confirmed data up
#define RADIOLIB_LORAWAN_MHDR_MTYPE_CONF_DATA_DOWN (0x05 << 5) // 7 5 confirmed data down
#define RADIOLIB_LORAWAN_MHDR_MTYPE_PROPRIETARY (0x07 << 5) // 7 5 proprietary
#define RADIOLIB_LORAWAN_MHDR_MTYPE_MASK (0x07 << 5) // 7 5 bitmask of all possible options
#define RADIOLIB_LORAWAN_MHDR_MAJOR_R1 (0x00 << 0) // 1 0 major version: LoRaWAN R1
#define RADIOLIB_LW_MHDR_MTYPE_JOIN_REQUEST (0x00 << 5) // 7 5 message type: join request
#define RADIOLIB_LW_MHDR_MTYPE_JOIN_ACCEPT (0x01 << 5) // 7 5 join accept
#define RADIOLIB_LW_MHDR_MTYPE_UNCONF_DATA_UP (0x02 << 5) // 7 5 unconfirmed data up
#define RADIOLIB_LW_MHDR_MTYPE_UNCONF_DATA_DOWN (0x03 << 5) // 7 5 unconfirmed data down
#define RADIOLIB_LW_MHDR_MTYPE_CONF_DATA_UP (0x04 << 5) // 7 5 confirmed data up
#define RADIOLIB_LW_MHDR_MTYPE_CONF_DATA_DOWN (0x05 << 5) // 7 5 confirmed data down
#define RADIOLIB_LW_MHDR_MTYPE_PROPRIETARY (0x07 << 5) // 7 5 proprietary
#define RADIOLIB_LW_MHDR_MTYPE_MASK (0x07 << 5) // 7 5 bitmask of all possible options
#define RADIOLIB_LW_MHDR_MAJOR_R1 (0x00 << 0) // 1 0 major version: LoRaWAN R1
// frame control field encoding
#define RADIOLIB_LORAWAN_FCTRL_ADR_ENABLED (0x01 << 7) // 7 7 adaptive data rate: enabled
#define RADIOLIB_LORAWAN_FCTRL_ADR_DISABLED (0x00 << 7) // 7 7 disabled
#define RADIOLIB_LORAWAN_FCTRL_ADR_ACK_REQ (0x01 << 6) // 6 6 adaptive data rate ACK request
#define RADIOLIB_LORAWAN_FCTRL_ACK (0x01 << 5) // 5 5 confirmed message acknowledge
#define RADIOLIB_LORAWAN_FCTRL_FRAME_PENDING (0x01 << 4) // 4 4 downlink frame is pending
#define RADIOLIB_LW_FCTRL_ADR_ENABLED (0x01 << 7) // 7 7 adaptive data rate: enabled
#define RADIOLIB_LW_FCTRL_ADR_DISABLED (0x00 << 7) // 7 7 disabled
#define RADIOLIB_LW_FCTRL_ADR_ACK_REQ (0x01 << 6) // 6 6 adaptive data rate ACK request
#define RADIOLIB_LW_FCTRL_ACK (0x01 << 5) // 5 5 confirmed message acknowledge
#define RADIOLIB_LW_FCTRL_FRAME_PENDING (0x01 << 4) // 4 4 downlink frame is pending
// port field
#define RADIOLIB_LORAWAN_FPORT_MAC_COMMAND (0x00 << 0) // 7 0 payload contains MAC commands only
#define RADIOLIB_LORAWAN_FPORT_RESERVED (0xE0 << 0) // 7 0 reserved port values
#define RADIOLIB_LW_FPORT_MAC_COMMAND (0x00 << 0) // 7 0 payload contains MAC commands only
#define RADIOLIB_LW_FPORT_RESERVED (0xE0 << 0) // 7 0 reserved port values
// MAC commands - only those sent from end-device to gateway
#define RADIOLIB_LORAWAN_LINK_CHECK_REQ (0x02 << 0) // 7 0 MAC command: request to check connectivity to network
#define RADIOLIB_LORAWAN_LINK_ADR_ANS (0x03 << 0) // 7 0 answer to ADR change
#define RADIOLIB_LORAWAN_DUTY_CYCLE_ANS (0x04 << 0) // 7 0 answer to duty cycle change
#define RADIOLIB_LORAWAN_RX_PARAM_SETUP_ANS (0x05 << 0) // 7 0 answer to reception slot setup request
#define RADIOLIB_LORAWAN_DEV_STATUS_ANS (0x06 << 0) // 7 0 device status information
#define RADIOLIB_LORAWAN_NEW_CHANNEL_ANS (0x07 << 0) // 7 0 acknowledges change of a radio channel
#define RADIOLIB_LORAWAN_RX_TIMING_SETUP_ANS (0x08 << 0) // 7 0 acknowledges change of a reception slots timing
#define RADIOLIB_LW_LINK_CHECK_REQ (0x02 << 0) // 7 0 MAC command: request to check connectivity to network
#define RADIOLIB_LW_LINK_ADR_ANS (0x03 << 0) // 7 0 answer to ADR change
#define RADIOLIB_LW_DUTY_CYCLE_ANS (0x04 << 0) // 7 0 answer to duty cycle change
#define RADIOLIB_LW_RX_PARAM_SETUP_ANS (0x05 << 0) // 7 0 answer to reception slot setup request
#define RADIOLIB_LW_DEV_STATUS_ANS (0x06 << 0) // 7 0 device status information
#define RADIOLIB_LW_NEW_CHANNEL_ANS (0x07 << 0) // 7 0 acknowledges change of a radio channel
#define RADIOLIB_LW_RX_TIMING_SETUP_ANS (0x08 << 0) // 7 0 acknowledges change of a reception slots timing
#define RADIOLIB_LORAWAN_NOPTS_LEN (8)
#define RADIOLIB_LW_NOPTS_LEN (8)
// data rate encoding
#define RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K (0x01 << 7) // 7 7 FSK @ 50 kbps
#define RADIOLIB_LORAWAN_DATA_RATE_SF_12 (0x06 << 4) // 6 4 LoRa spreading factor: SF12
#define RADIOLIB_LORAWAN_DATA_RATE_SF_11 (0x05 << 4) // 6 4 SF11
#define RADIOLIB_LORAWAN_DATA_RATE_SF_10 (0x04 << 4) // 6 4 SF10
#define RADIOLIB_LORAWAN_DATA_RATE_SF_9 (0x03 << 4) // 6 4 SF9
#define RADIOLIB_LORAWAN_DATA_RATE_SF_8 (0x02 << 4) // 6 4 SF8
#define RADIOLIB_LORAWAN_DATA_RATE_SF_7 (0x01 << 4) // 6 4 SF7
#define RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ (0x00 << 2) // 3 2 LoRa bandwidth: 500 kHz
#define RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ (0x01 << 2) // 3 2 250 kHz
#define RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ (0x02 << 2) // 3 2 125 kHz
#define RADIOLIB_LORAWAN_DATA_RATE_BW_RESERVED (0x03 << 2) // 3 2 reserved value
#define RADIOLIB_LORAWAN_DATA_RATE_CR_4_5 (0x00 << 0) // 1 0 LoRa coding rate: 4/5
#define RADIOLIB_LORAWAN_DATA_RATE_CR_4_6 (0x01 << 0) // 1 0 4/6
#define RADIOLIB_LORAWAN_DATA_RATE_CR_4_7 (0x02 << 0) // 1 0 4/7
#define RADIOLIB_LORAWAN_DATA_RATE_CR_4_8 (0x03 << 0) // 1 0 4/8
#define RADIOLIB_LORAWAN_DATA_RATE_UNUSED (0xFF << 0) // 7 0 unused data rate
#define RADIOLIB_LW_DATA_RATE_FSK_50_K (0x01 << 7) // 7 7 FSK @ 50 kbps
#define RADIOLIB_LW_DATA_RATE_SF_12 (0x06 << 4) // 6 4 LoRa spreading factor: SF12
#define RADIOLIB_LW_DATA_RATE_SF_11 (0x05 << 4) // 6 4 SF11
#define RADIOLIB_LW_DATA_RATE_SF_10 (0x04 << 4) // 6 4 SF10
#define RADIOLIB_LW_DATA_RATE_SF_9 (0x03 << 4) // 6 4 SF9
#define RADIOLIB_LW_DATA_RATE_SF_8 (0x02 << 4) // 6 4 SF8
#define RADIOLIB_LW_DATA_RATE_SF_7 (0x01 << 4) // 6 4 SF7
#define RADIOLIB_LW_DATA_RATE_BW_500_KHZ (0x00 << 2) // 3 2 LoRa bandwidth: 500 kHz
#define RADIOLIB_LW_DATA_RATE_BW_250_KHZ (0x01 << 2) // 3 2 250 kHz
#define RADIOLIB_LW_DATA_RATE_BW_125_KHZ (0x02 << 2) // 3 2 125 kHz
#define RADIOLIB_LW_DATA_RATE_BW_RESERVED (0x03 << 2) // 3 2 reserved value
#define RADIOLIB_LW_DATA_RATE_CR_4_5 (0x00 << 0) // 1 0 LoRa coding rate: 4/5
#define RADIOLIB_LW_DATA_RATE_CR_4_6 (0x01 << 0) // 1 0 4/6
#define RADIOLIB_LW_DATA_RATE_CR_4_7 (0x02 << 0) // 1 0 4/7
#define RADIOLIB_LW_DATA_RATE_CR_4_8 (0x03 << 0) // 1 0 4/8
#define RADIOLIB_LW_DATA_RATE_UNUSED (0xFF << 0) // 7 0 unused data rate
#define RADIOLIB_LORAWAN_CHANNEL_DIR_UPLINK (0x00 << 0)
#define RADIOLIB_LORAWAN_CHANNEL_DIR_DOWNLINK (0x01 << 0)
#define RADIOLIB_LORAWAN_CHANNEL_DIR_BOTH (0x02 << 0)
#define RADIOLIB_LORAWAN_CHANNEL_DIR_NONE (0x03 << 0)
#define RADIOLIB_LORAWAN_BAND_DYNAMIC (0)
#define RADIOLIB_LORAWAN_BAND_FIXED (1)
#define RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES (15)
#define RADIOLIB_LORAWAN_CHANNEL_INDEX_NONE (0xFF >> 0)
#define RADIOLIB_LW_CHANNEL_DIR_UPLINK (0x00 << 0)
#define RADIOLIB_LW_CHANNEL_DIR_DOWNLINK (0x01 << 0)
#define RADIOLIB_LW_CHANNEL_DIR_BOTH (0x02 << 0)
#define RADIOLIB_LW_CHANNEL_DIR_NONE (0x03 << 0)
#define RADIOLIB_LW_BAND_DYNAMIC (0)
#define RADIOLIB_LW_BAND_FIXED (1)
#define RADIOLIB_LW_CHANNEL_NUM_DATARATES (15)
#define RADIOLIB_LW_CHANNEL_INDEX_NONE (0xFF >> 0)
// recommended default settings
#define RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS (1000)
#define RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS ((RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS) + 1000)
#define RADIOLIB_LORAWAN_RX1_DR_OFFSET (0)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_DELAY_1_MS (5000)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_DELAY_2_MS (6000)
#define RADIOLIB_LORAWAN_MAX_FCNT_GAP (16384)
#define RADIOLIB_LORAWAN_ADR_ACK_LIMIT_EXP (0x06)
#define RADIOLIB_LORAWAN_ADR_ACK_DELAY_EXP (0x05)
#define RADIOLIB_LORAWAN_RETRANSMIT_TIMEOUT_MIN_MS (1000)
#define RADIOLIB_LORAWAN_RETRANSMIT_TIMEOUT_MAX_MS (3000)
#define RADIOLIB_LORAWAN_POWER_STEP_SIZE_DBM (-2)
#define RADIOLIB_LORAWAN_REJOIN_MAX_COUNT_N (10) // send rejoin request 16384 uplinks
#define RADIOLIB_LORAWAN_REJOIN_MAX_TIME_N (15) // once every year, not actually implemented
#define RADIOLIB_LW_RECEIVE_DELAY_1_MS (1000)
#define RADIOLIB_LW_RECEIVE_DELAY_2_MS ((RADIOLIB_LW_RECEIVE_DELAY_1_MS) + 1000)
#define RADIOLIB_LW_RX1_DR_OFFSET (0)
#define RADIOLIB_LW_JOIN_ACCEPT_DELAY_1_MS (5000)
#define RADIOLIB_LW_JOIN_ACCEPT_DELAY_2_MS (6000)
#define RADIOLIB_LW_MAX_FCNT_GAP (16384)
#define RADIOLIB_LW_ADR_ACK_LIMIT_EXP (0x06)
#define RADIOLIB_LW_ADR_ACK_DELAY_EXP (0x05)
#define RADIOLIB_LW_RETRANSMIT_TIMEOUT_MIN_MS (1000)
#define RADIOLIB_LW_RETRANSMIT_TIMEOUT_MAX_MS (3000)
#define RADIOLIB_LW_POWER_STEP_SIZE_DBM (-2)
#define RADIOLIB_LW_REJOIN_MAX_COUNT_N (10) // send rejoin request 16384 uplinks
#define RADIOLIB_LW_REJOIN_MAX_TIME_N (15) // once every year, not actually implemented
// join request message layout
#define RADIOLIB_LORAWAN_JOIN_REQUEST_LEN (23)
#define RADIOLIB_LORAWAN_JOIN_REQUEST_JOIN_EUI_POS (1)
#define RADIOLIB_LORAWAN_JOIN_REQUEST_DEV_EUI_POS (9)
#define RADIOLIB_LORAWAN_JOIN_REQUEST_DEV_NONCE_POS (17)
#define RADIOLIB_LORAWAN_JOIN_REQUEST_TYPE (0xFF)
#define RADIOLIB_LORAWAN_JOIN_REQUEST_TYPE_0 (0x00)
#define RADIOLIB_LORAWAN_JOIN_REQUEST_TYPE_1 (0x01)
#define RADIOLIB_LORAWAN_JOIN_REQUEST_TYPE_2 (0x02)
#define RADIOLIB_LW_JOIN_REQUEST_LEN (23)
#define RADIOLIB_LW_JOIN_REQUEST_JOIN_EUI_POS (1)
#define RADIOLIB_LW_JOIN_REQUEST_DEV_EUI_POS (9)
#define RADIOLIB_LW_JOIN_REQUEST_DEV_NONCE_POS (17)
#define RADIOLIB_LW_JOIN_REQUEST_TYPE (0xFF)
#define RADIOLIB_LW_JOIN_REQUEST_TYPE_0 (0x00)
#define RADIOLIB_LW_JOIN_REQUEST_TYPE_1 (0x01)
#define RADIOLIB_LW_JOIN_REQUEST_TYPE_2 (0x02)
// join accept message layout
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_MAX_LEN (33)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_JOIN_NONCE_POS (1)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_HOME_NET_ID_POS (4)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_DEV_ADDR_POS (7)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_JOIN_EUI_POS (4)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_DL_SETTINGS_POS (11)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_RX_DELAY_POS (12)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_DEV_NONCE_POS (12)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_POS (13)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_LEN (16)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_TYPE_POS (RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_POS + RADIOLIB_LORAWAN_JOIN_ACCEPT_CFLIST_LEN - 1)
#define RADIOLIB_LW_JOIN_ACCEPT_MAX_LEN (33)
#define RADIOLIB_LW_JOIN_ACCEPT_JOIN_NONCE_POS (1)
#define RADIOLIB_LW_JOIN_ACCEPT_HOME_NET_ID_POS (4)
#define RADIOLIB_LW_JOIN_ACCEPT_DEV_ADDR_POS (7)
#define RADIOLIB_LW_JOIN_ACCEPT_JOIN_EUI_POS (4)
#define RADIOLIB_LW_JOIN_ACCEPT_DL_SETTINGS_POS (11)
#define RADIOLIB_LW_JOIN_ACCEPT_RX_DELAY_POS (12)
#define RADIOLIB_LW_JOIN_ACCEPT_DEV_NONCE_POS (12)
#define RADIOLIB_LW_JOIN_ACCEPT_CFLIST_POS (13)
#define RADIOLIB_LW_JOIN_ACCEPT_CFLIST_LEN (16)
#define RADIOLIB_LW_JOIN_ACCEPT_CFLIST_TYPE_POS (RADIOLIB_LW_JOIN_ACCEPT_CFLIST_POS + RADIOLIB_LW_JOIN_ACCEPT_CFLIST_LEN - 1)
// join accept message variables
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_R_1_0 (0x00 << 7) // 7 7 LoRaWAN revision: 1.0
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_R_1_1 (0x01 << 7) // 7 7 1.1
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_F_NWK_S_INT_KEY (0x01)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_APP_S_KEY (0x02)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_S_NWK_S_INT_KEY (0x03)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_NWK_S_ENC_KEY (0x04)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_JS_ENC_KEY (0x05)
#define RADIOLIB_LORAWAN_JOIN_ACCEPT_JS_INT_KEY (0x06)
#define RADIOLIB_LW_JOIN_ACCEPT_R_1_0 (0x00 << 7) // 7 7 LoRaWAN revision: 1.0
#define RADIOLIB_LW_JOIN_ACCEPT_R_1_1 (0x01 << 7) // 7 7 1.1
#define RADIOLIB_LW_JOIN_ACCEPT_F_NWK_S_INT_KEY (0x01)
#define RADIOLIB_LW_JOIN_ACCEPT_APP_S_KEY (0x02)
#define RADIOLIB_LW_JOIN_ACCEPT_S_NWK_S_INT_KEY (0x03)
#define RADIOLIB_LW_JOIN_ACCEPT_NWK_S_ENC_KEY (0x04)
#define RADIOLIB_LW_JOIN_ACCEPT_JS_ENC_KEY (0x05)
#define RADIOLIB_LW_JOIN_ACCEPT_JS_INT_KEY (0x06)
// frame header layout
#define RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS (16)
#define RADIOLIB_LORAWAN_FHDR_DEV_ADDR_POS (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 1)
#define RADIOLIB_LORAWAN_FHDR_FCTRL_POS (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 5)
#define RADIOLIB_LORAWAN_FHDR_FCNT_POS (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 6)
#define RADIOLIB_LORAWAN_FHDR_FOPTS_POS (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 8)
#define RADIOLIB_LORAWAN_FHDR_FOPTS_LEN_MASK (0x0F)
#define RADIOLIB_LORAWAN_FHDR_FOPTS_MAX_LEN (15)
#define RADIOLIB_LORAWAN_FHDR_FPORT_POS(FOPTS) (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 8 + (FOPTS))
#define RADIOLIB_LORAWAN_FRAME_PAYLOAD_POS(FOPTS) (RADIOLIB_LORAWAN_FHDR_LEN_START_OFFS + 9 + (FOPTS))
#define RADIOLIB_LORAWAN_FRAME_LEN(PAYLOAD, FOPTS) (16 + 13 + (PAYLOAD) + (FOPTS))
#define RADIOLIB_LW_FHDR_LEN_START_OFFS (16)
#define RADIOLIB_LW_FHDR_DEV_ADDR_POS (RADIOLIB_LW_FHDR_LEN_START_OFFS + 1)
#define RADIOLIB_LW_FHDR_FCTRL_POS (RADIOLIB_LW_FHDR_LEN_START_OFFS + 5)
#define RADIOLIB_LW_FHDR_FCNT_POS (RADIOLIB_LW_FHDR_LEN_START_OFFS + 6)
#define RADIOLIB_LW_FHDR_FOPTS_POS (RADIOLIB_LW_FHDR_LEN_START_OFFS + 8)
#define RADIOLIB_LW_FHDR_FOPTS_LEN_MASK (0x0F)
#define RADIOLIB_LW_FHDR_FOPTS_MAX_LEN (15)
#define RADIOLIB_LW_FHDR_FPORT_POS(FOPTS) (RADIOLIB_LW_FHDR_LEN_START_OFFS + 8 + (FOPTS))
#define RADIOLIB_LW_FRAME_PAYLOAD_POS(FOPTS) (RADIOLIB_LW_FHDR_LEN_START_OFFS + 9 + (FOPTS))
#define RADIOLIB_LW_FRAME_LEN(PAYLOAD, FOPTS) (16 + 13 + (PAYLOAD) + (FOPTS))
// payload encryption/MIC blocks common layout
#define RADIOLIB_LORAWAN_BLOCK_MAGIC_POS (0)
#define RADIOLIB_LORAWAN_BLOCK_CONF_FCNT_POS (1)
#define RADIOLIB_LORAWAN_BLOCK_DIR_POS (5)
#define RADIOLIB_LORAWAN_BLOCK_DEV_ADDR_POS (6)
#define RADIOLIB_LORAWAN_BLOCK_FCNT_POS (10)
#define RADIOLIB_LW_BLOCK_MAGIC_POS (0)
#define RADIOLIB_LW_BLOCK_CONF_FCNT_POS (1)
#define RADIOLIB_LW_BLOCK_DIR_POS (5)
#define RADIOLIB_LW_BLOCK_DEV_ADDR_POS (6)
#define RADIOLIB_LW_BLOCK_FCNT_POS (10)
// payload encryption block layout
#define RADIOLIB_LORAWAN_ENC_BLOCK_MAGIC (0x01)
#define RADIOLIB_LORAWAN_ENC_BLOCK_COUNTER_ID_POS (4)
#define RADIOLIB_LORAWAN_ENC_BLOCK_COUNTER_POS (15)
#define RADIOLIB_LW_ENC_BLOCK_MAGIC (0x01)
#define RADIOLIB_LW_ENC_BLOCK_COUNTER_ID_POS (4)
#define RADIOLIB_LW_ENC_BLOCK_COUNTER_POS (15)
// payload MIC blocks layout
#define RADIOLIB_LORAWAN_MIC_BLOCK_MAGIC (0x49)
#define RADIOLIB_LORAWAN_MIC_BLOCK_LEN_POS (15)
#define RADIOLIB_LORAWAN_MIC_DATA_RATE_POS (3)
#define RADIOLIB_LORAWAN_MIC_CH_INDEX_POS (4)
#define RADIOLIB_LW_MIC_BLOCK_MAGIC (0x49)
#define RADIOLIB_LW_MIC_BLOCK_LEN_POS (15)
#define RADIOLIB_LW_MIC_DATA_RATE_POS (3)
#define RADIOLIB_LW_MIC_CH_INDEX_POS (4)
// maximum allowed dwell time on bands that implement dwell time limitations
#define RADIOLIB_LORAWAN_DWELL_TIME (400)
#define RADIOLIB_LW_DWELL_TIME (400)
// unused frame counter value
#define RADIOLIB_LORAWAN_FCNT_NONE (0xFFFFFFFF)
#define RADIOLIB_LW_FCNT_NONE (0xFFFFFFFF)
// MAC commands
#define RADIOLIB_LORAWAN_NUM_MAC_COMMANDS (16)
#define RADIOLIB_LW_NUM_MAC_COMMANDS (16)
#define RADIOLIB_LORAWAN_MAC_RESET (0x01)
#define RADIOLIB_LORAWAN_MAC_LINK_CHECK (0x02)
#define RADIOLIB_LORAWAN_MAC_LINK_ADR (0x03)
#define RADIOLIB_LORAWAN_MAC_DUTY_CYCLE (0x04)
#define RADIOLIB_LORAWAN_MAC_RX_PARAM_SETUP (0x05)
#define RADIOLIB_LORAWAN_MAC_DEV_STATUS (0x06)
#define RADIOLIB_LORAWAN_MAC_NEW_CHANNEL (0x07)
#define RADIOLIB_LORAWAN_MAC_RX_TIMING_SETUP (0x08)
#define RADIOLIB_LORAWAN_MAC_TX_PARAM_SETUP (0x09)
#define RADIOLIB_LORAWAN_MAC_DL_CHANNEL (0x0A)
#define RADIOLIB_LORAWAN_MAC_REKEY (0x0B)
#define RADIOLIB_LORAWAN_MAC_ADR_PARAM_SETUP (0x0C)
#define RADIOLIB_LORAWAN_MAC_DEVICE_TIME (0x0D)
#define RADIOLIB_LORAWAN_MAC_FORCE_REJOIN (0x0E)
#define RADIOLIB_LORAWAN_MAC_REJOIN_PARAM_SETUP (0x0F)
#define RADIOLIB_LORAWAN_MAC_PROPRIETARY (0x80)
#define RADIOLIB_LW_MAC_RESET (0x01)
#define RADIOLIB_LW_MAC_LINK_CHECK (0x02)
#define RADIOLIB_LW_MAC_LINK_ADR (0x03)
#define RADIOLIB_LW_MAC_DUTY_CYCLE (0x04)
#define RADIOLIB_LW_MAC_RX_PARAM_SETUP (0x05)
#define RADIOLIB_LW_MAC_DEV_STATUS (0x06)
#define RADIOLIB_LW_MAC_NEW_CHANNEL (0x07)
#define RADIOLIB_LW_MAC_RX_TIMING_SETUP (0x08)
#define RADIOLIB_LW_MAC_TX_PARAM_SETUP (0x09)
#define RADIOLIB_LW_MAC_DL_CHANNEL (0x0A)
#define RADIOLIB_LW_MAC_REKEY (0x0B)
#define RADIOLIB_LW_MAC_ADR_PARAM_SETUP (0x0C)
#define RADIOLIB_LW_MAC_DEVICE_TIME (0x0D)
#define RADIOLIB_LW_MAC_FORCE_REJOIN (0x0E)
#define RADIOLIB_LW_MAC_REJOIN_PARAM_SETUP (0x0F)
#define RADIOLIB_LW_MAC_PROPRIETARY (0x80)
// the length of internal MAC command queue - hopefully this is enough for most use cases
#define RADIOLIB_LORAWAN_MAC_COMMAND_QUEUE_SIZE (9)
#define RADIOLIB_LW_MAC_COMMAND_QUEUE_SIZE (9)
// the maximum number of simultaneously available channels
#define RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS (16)
#define RADIOLIB_LW_NUM_AVAILABLE_CHANNELS (16)
// maximum MAC command sizes
#define RADIOLIB_LORAWAN_MAX_MAC_COMMAND_LEN_DOWN (5)
#define RADIOLIB_LORAWAN_MAX_MAC_COMMAND_LEN_UP (2)
#define RADIOLIB_LORAWAN_MAX_NUM_ADR_COMMANDS (8)
#define RADIOLIB_LW_MAX_MAC_COMMAND_LEN_DOWN (5)
#define RADIOLIB_LW_MAX_MAC_COMMAND_LEN_UP (2)
#define RADIOLIB_LW_MAX_NUM_ADR_COMMANDS (8)
/*!
\struct LoRaWANMacSpec_t
@ -214,24 +214,24 @@ struct LoRaWANMacSpec_t {
const bool user;
};
constexpr LoRaWANMacSpec_t MacTable[RADIOLIB_LORAWAN_NUM_MAC_COMMANDS + 1] = {
constexpr LoRaWANMacSpec_t MacTable[RADIOLIB_LW_NUM_MAC_COMMANDS + 1] = {
{ 0x00, 0, 0, false }, // not an actual MAC command, exists for index offsetting
{ RADIOLIB_LORAWAN_MAC_RESET, 1, 1, false },
{ RADIOLIB_LORAWAN_MAC_LINK_CHECK, 2, 0, true },
{ RADIOLIB_LORAWAN_MAC_LINK_ADR, 4, 1, false },
{ RADIOLIB_LORAWAN_MAC_DUTY_CYCLE, 1, 0, false },
{ RADIOLIB_LORAWAN_MAC_RX_PARAM_SETUP, 4, 1, false },
{ RADIOLIB_LORAWAN_MAC_DEV_STATUS, 0, 2, false },
{ RADIOLIB_LORAWAN_MAC_NEW_CHANNEL, 5, 1, false },
{ RADIOLIB_LORAWAN_MAC_RX_TIMING_SETUP, 1, 0, false },
{ RADIOLIB_LORAWAN_MAC_TX_PARAM_SETUP, 1, 0, false },
{ RADIOLIB_LORAWAN_MAC_DL_CHANNEL, 4, 1, false },
{ RADIOLIB_LORAWAN_MAC_REKEY, 1, 1, false },
{ RADIOLIB_LORAWAN_MAC_ADR_PARAM_SETUP, 1, 0, false },
{ RADIOLIB_LORAWAN_MAC_DEVICE_TIME, 5, 0, true },
{ RADIOLIB_LORAWAN_MAC_FORCE_REJOIN, 2, 0, false },
{ RADIOLIB_LORAWAN_MAC_REJOIN_PARAM_SETUP, 1, 1, false },
{ RADIOLIB_LORAWAN_MAC_PROPRIETARY, 5, 0, true }
{ RADIOLIB_LW_MAC_RESET, 1, 1, false },
{ RADIOLIB_LW_MAC_LINK_CHECK, 2, 0, true },
{ RADIOLIB_LW_MAC_LINK_ADR, 4, 1, false },
{ RADIOLIB_LW_MAC_DUTY_CYCLE, 1, 0, false },
{ RADIOLIB_LW_MAC_RX_PARAM_SETUP, 4, 1, false },
{ RADIOLIB_LW_MAC_DEV_STATUS, 0, 2, false },
{ RADIOLIB_LW_MAC_NEW_CHANNEL, 5, 1, false },
{ RADIOLIB_LW_MAC_RX_TIMING_SETUP, 1, 0, false },
{ RADIOLIB_LW_MAC_TX_PARAM_SETUP, 1, 0, false },
{ RADIOLIB_LW_MAC_DL_CHANNEL, 4, 1, false },
{ RADIOLIB_LW_MAC_REKEY, 1, 1, false },
{ RADIOLIB_LW_MAC_ADR_PARAM_SETUP, 1, 0, false },
{ RADIOLIB_LW_MAC_DEVICE_TIME, 5, 0, true },
{ RADIOLIB_LW_MAC_FORCE_REJOIN, 2, 0, false },
{ RADIOLIB_LW_MAC_REJOIN_PARAM_SETUP, 1, 1, false },
{ RADIOLIB_LW_MAC_PROPRIETARY, 5, 0, true }
};
/*!
@ -264,59 +264,59 @@ struct LoRaWANMacCommandQueue_t {
uint8_t len;
/*! \brief MAC command buffer */
LoRaWANMacCommand_t commands[RADIOLIB_LORAWAN_MAC_COMMAND_QUEUE_SIZE];
LoRaWANMacCommand_t commands[RADIOLIB_LW_MAC_COMMAND_QUEUE_SIZE];
};
#define RADIOLIB_LORAWAN_NONCES_VERSION_VAL (0x0001)
#define RADIOLIB_LW_NONCES_VERSION_VAL (0x0001)
enum LoRaWANSchemeBase_t {
RADIOLIB_LORAWAN_NONCES_START = 0x00,
RADIOLIB_LORAWAN_NONCES_VERSION = RADIOLIB_LORAWAN_NONCES_START, // 2 bytes
RADIOLIB_LORAWAN_NONCES_MODE = RADIOLIB_LORAWAN_NONCES_VERSION + sizeof(uint16_t), // 2 bytes
RADIOLIB_LORAWAN_NONCES_CLASS = RADIOLIB_LORAWAN_NONCES_MODE + sizeof(uint16_t), // 1 byte
RADIOLIB_LORAWAN_NONCES_PLAN = RADIOLIB_LORAWAN_NONCES_CLASS + sizeof(uint8_t), // 1 byte
RADIOLIB_LORAWAN_NONCES_CHECKSUM = RADIOLIB_LORAWAN_NONCES_PLAN + sizeof(uint8_t), // 2 bytes
RADIOLIB_LORAWAN_NONCES_DEV_NONCE = RADIOLIB_LORAWAN_NONCES_CHECKSUM + sizeof(uint16_t), // 2 bytes
RADIOLIB_LORAWAN_NONCES_JOIN_NONCE = RADIOLIB_LORAWAN_NONCES_DEV_NONCE + sizeof(uint16_t), // 3 bytes
RADIOLIB_LORAWAN_NONCES_ACTIVE = RADIOLIB_LORAWAN_NONCES_JOIN_NONCE + 3, // 1 byte
RADIOLIB_LORAWAN_NONCES_SIGNATURE = RADIOLIB_LORAWAN_NONCES_ACTIVE + sizeof(uint8_t), // 2 bytes
RADIOLIB_LORAWAN_NONCES_BUF_SIZE = RADIOLIB_LORAWAN_NONCES_SIGNATURE + sizeof(uint16_t) // Nonces buffer size
RADIOLIB_LW_NONCES_START = 0x00,
RADIOLIB_LW_NONCES_VERSION = RADIOLIB_LW_NONCES_START, // 2 bytes
RADIOLIB_LW_NONCES_MODE = RADIOLIB_LW_NONCES_VERSION + sizeof(uint16_t), // 2 bytes
RADIOLIB_LW_NONCES_CLASS = RADIOLIB_LW_NONCES_MODE + sizeof(uint16_t), // 1 byte
RADIOLIB_LW_NONCES_PLAN = RADIOLIB_LW_NONCES_CLASS + sizeof(uint8_t), // 1 byte
RADIOLIB_LW_NONCES_CHECKSUM = RADIOLIB_LW_NONCES_PLAN + sizeof(uint8_t), // 2 bytes
RADIOLIB_LW_NONCES_DEV_NONCE = RADIOLIB_LW_NONCES_CHECKSUM + sizeof(uint16_t), // 2 bytes
RADIOLIB_LW_NONCES_JOIN_NONCE = RADIOLIB_LW_NONCES_DEV_NONCE + sizeof(uint16_t), // 3 bytes
RADIOLIB_LW_NONCES_ACTIVE = RADIOLIB_LW_NONCES_JOIN_NONCE + 3, // 1 byte
RADIOLIB_LW_NONCES_SIGNATURE = RADIOLIB_LW_NONCES_ACTIVE + sizeof(uint8_t), // 2 bytes
RADIOLIB_LW_NONCES_BUF_SIZE = RADIOLIB_LW_NONCES_SIGNATURE + sizeof(uint16_t) // Nonces buffer size
};
enum LoRaWANSchemeSession_t {
RADIOLIB_LORAWAN_SESSION_START = 0x00,
RADIOLIB_LORAWAN_SESSION_NWK_SENC_KEY = RADIOLIB_LORAWAN_SESSION_START, // 16 bytes
RADIOLIB_LORAWAN_SESSION_APP_SKEY = RADIOLIB_LORAWAN_SESSION_NWK_SENC_KEY + RADIOLIB_AES128_BLOCK_SIZE, // 16 bytes
RADIOLIB_LORAWAN_SESSION_FNWK_SINT_KEY = RADIOLIB_LORAWAN_SESSION_APP_SKEY + RADIOLIB_AES128_BLOCK_SIZE, // 16 bytes
RADIOLIB_LORAWAN_SESSION_SNWK_SINT_KEY = RADIOLIB_LORAWAN_SESSION_FNWK_SINT_KEY + RADIOLIB_AES128_BLOCK_SIZE, // 16 bytes
RADIOLIB_LORAWAN_SESSION_DEV_ADDR = RADIOLIB_LORAWAN_SESSION_SNWK_SINT_KEY + RADIOLIB_AES128_BLOCK_SIZE, // 4 bytes
RADIOLIB_LORAWAN_SESSION_NONCES_SIGNATURE = RADIOLIB_LORAWAN_SESSION_DEV_ADDR + sizeof(uint32_t), // 2 bytes
RADIOLIB_LORAWAN_SESSION_A_FCNT_DOWN = RADIOLIB_LORAWAN_SESSION_NONCES_SIGNATURE + sizeof(uint16_t), // 4 bytes
RADIOLIB_LORAWAN_SESSION_CONF_FCNT_UP = RADIOLIB_LORAWAN_SESSION_A_FCNT_DOWN + sizeof(uint32_t), // 4 bytes
RADIOLIB_LORAWAN_SESSION_CONF_FCNT_DOWN = RADIOLIB_LORAWAN_SESSION_CONF_FCNT_UP + sizeof(uint32_t), // 4 bytes
RADIOLIB_LORAWAN_SESSION_RJ_COUNT0 = RADIOLIB_LORAWAN_SESSION_CONF_FCNT_DOWN + sizeof(uint32_t), // 2 bytes
RADIOLIB_LORAWAN_SESSION_RJ_COUNT1 = RADIOLIB_LORAWAN_SESSION_RJ_COUNT0 + sizeof(uint16_t), // 2 bytes
RADIOLIB_LORAWAN_SESSION_HOMENET_ID = RADIOLIB_LORAWAN_SESSION_RJ_COUNT1 + sizeof(uint16_t), // 4 bytes
RADIOLIB_LORAWAN_SESSION_VERSION = RADIOLIB_LORAWAN_SESSION_HOMENET_ID + sizeof(uint32_t), // 1 byte
RADIOLIB_LORAWAN_SESSION_DUTY_CYCLE = RADIOLIB_LORAWAN_SESSION_VERSION + sizeof(uint8_t), // 1 byte
RADIOLIB_LORAWAN_SESSION_RX_PARAM_SETUP = RADIOLIB_LORAWAN_SESSION_DUTY_CYCLE + MacTable[RADIOLIB_LORAWAN_MAC_DUTY_CYCLE].lenDn, // 4 bytes
RADIOLIB_LORAWAN_SESSION_RX_TIMING_SETUP = RADIOLIB_LORAWAN_SESSION_RX_PARAM_SETUP + MacTable[RADIOLIB_LORAWAN_MAC_RX_PARAM_SETUP].lenDn, // 1 byte
RADIOLIB_LORAWAN_SESSION_TX_PARAM_SETUP = RADIOLIB_LORAWAN_SESSION_RX_TIMING_SETUP + MacTable[RADIOLIB_LORAWAN_MAC_RX_TIMING_SETUP].lenDn, // 1 byte
RADIOLIB_LORAWAN_SESSION_ADR_PARAM_SETUP = RADIOLIB_LORAWAN_SESSION_TX_PARAM_SETUP + MacTable[RADIOLIB_LORAWAN_MAC_TX_PARAM_SETUP].lenDn, // 1 byte
RADIOLIB_LORAWAN_SESSION_REJOIN_PARAM_SETUP = RADIOLIB_LORAWAN_SESSION_ADR_PARAM_SETUP + MacTable[RADIOLIB_LORAWAN_MAC_ADR_PARAM_SETUP].lenDn, // 1 byte
RADIOLIB_LORAWAN_SESSION_BEACON_FREQ = RADIOLIB_LORAWAN_SESSION_REJOIN_PARAM_SETUP + MacTable[RADIOLIB_LORAWAN_MAC_REJOIN_PARAM_SETUP].lenDn, // 3 bytes
RADIOLIB_LORAWAN_SESSION_PING_SLOT_CHANNEL = RADIOLIB_LORAWAN_SESSION_BEACON_FREQ + 3, // 4 bytes
RADIOLIB_LORAWAN_SESSION_PERIODICITY = RADIOLIB_LORAWAN_SESSION_PING_SLOT_CHANNEL + 4, // 1 byte
RADIOLIB_LORAWAN_SESSION_LAST_TIME = RADIOLIB_LORAWAN_SESSION_PERIODICITY + 1, // 4 bytes
RADIOLIB_LORAWAN_SESSION_UL_CHANNELS = RADIOLIB_LORAWAN_SESSION_LAST_TIME + 4, // 16*5 bytes
RADIOLIB_LORAWAN_SESSION_DL_CHANNELS = RADIOLIB_LORAWAN_SESSION_UL_CHANNELS + 16*MacTable[RADIOLIB_LORAWAN_MAC_NEW_CHANNEL].lenDn, // 16*4 bytes
RADIOLIB_LORAWAN_SESSION_MAC_QUEUE_UL = RADIOLIB_LORAWAN_SESSION_DL_CHANNELS + 16*MacTable[RADIOLIB_LORAWAN_MAC_DL_CHANNEL].lenDn, // 9*8+2 bytes
RADIOLIB_LORAWAN_SESSION_N_FCNT_DOWN = RADIOLIB_LORAWAN_SESSION_MAC_QUEUE_UL + sizeof(LoRaWANMacCommandQueue_t), // 4 bytes
RADIOLIB_LORAWAN_SESSION_ADR_FCNT = RADIOLIB_LORAWAN_SESSION_N_FCNT_DOWN + sizeof(uint32_t), // 4 bytes
RADIOLIB_LORAWAN_SESSION_LINK_ADR = RADIOLIB_LORAWAN_SESSION_ADR_FCNT + sizeof(uint32_t), // 4 bytes
RADIOLIB_LORAWAN_SESSION_FCNT_UP = RADIOLIB_LORAWAN_SESSION_LINK_ADR + MacTable[RADIOLIB_LORAWAN_MAC_LINK_ADR].lenDn, // 4 bytes
RADIOLIB_LORAWAN_SESSION_SIGNATURE = RADIOLIB_LORAWAN_SESSION_FCNT_UP + sizeof(uint32_t), // 2 bytes
RADIOLIB_LORAWAN_SESSION_BUF_SIZE = RADIOLIB_LORAWAN_SESSION_SIGNATURE + sizeof(uint16_t) // Session buffer size
RADIOLIB_LW_SESSION_START = 0x00,
RADIOLIB_LW_SESSION_NWK_SENC_KEY = RADIOLIB_LW_SESSION_START, // 16 bytes
RADIOLIB_LW_SESSION_APP_SKEY = RADIOLIB_LW_SESSION_NWK_SENC_KEY + RADIOLIB_AES128_BLOCK_SIZE, // 16 bytes
RADIOLIB_LW_SESSION_FNWK_SINT_KEY = RADIOLIB_LW_SESSION_APP_SKEY + RADIOLIB_AES128_BLOCK_SIZE, // 16 bytes
RADIOLIB_LW_SESSION_SNWK_SINT_KEY = RADIOLIB_LW_SESSION_FNWK_SINT_KEY + RADIOLIB_AES128_BLOCK_SIZE, // 16 bytes
RADIOLIB_LW_SESSION_DEV_ADDR = RADIOLIB_LW_SESSION_SNWK_SINT_KEY + RADIOLIB_AES128_BLOCK_SIZE, // 4 bytes
RADIOLIB_LW_SESSION_NONCES_SIGNATURE = RADIOLIB_LW_SESSION_DEV_ADDR + sizeof(uint32_t), // 2 bytes
RADIOLIB_LW_SESSION_A_FCNT_DOWN = RADIOLIB_LW_SESSION_NONCES_SIGNATURE + sizeof(uint16_t), // 4 bytes
RADIOLIB_LW_SESSION_CONF_FCNT_UP = RADIOLIB_LW_SESSION_A_FCNT_DOWN + sizeof(uint32_t), // 4 bytes
RADIOLIB_LW_SESSION_CONF_FCNT_DOWN = RADIOLIB_LW_SESSION_CONF_FCNT_UP + sizeof(uint32_t), // 4 bytes
RADIOLIB_LW_SESSION_RJ_COUNT0 = RADIOLIB_LW_SESSION_CONF_FCNT_DOWN + sizeof(uint32_t), // 2 bytes
RADIOLIB_LW_SESSION_RJ_COUNT1 = RADIOLIB_LW_SESSION_RJ_COUNT0 + sizeof(uint16_t), // 2 bytes
RADIOLIB_LW_SESSION_HOMENET_ID = RADIOLIB_LW_SESSION_RJ_COUNT1 + sizeof(uint16_t), // 4 bytes
RADIOLIB_LW_SESSION_VERSION = RADIOLIB_LW_SESSION_HOMENET_ID + sizeof(uint32_t), // 1 byte
RADIOLIB_LW_SESSION_DUTY_CYCLE = RADIOLIB_LW_SESSION_VERSION + sizeof(uint8_t), // 1 byte
RADIOLIB_LW_SESSION_RX_PARAM_SETUP = RADIOLIB_LW_SESSION_DUTY_CYCLE + MacTable[RADIOLIB_LW_MAC_DUTY_CYCLE].lenDn, // 4 bytes
RADIOLIB_LW_SESSION_RX_TIMING_SETUP = RADIOLIB_LW_SESSION_RX_PARAM_SETUP + MacTable[RADIOLIB_LW_MAC_RX_PARAM_SETUP].lenDn, // 1 byte
RADIOLIB_LW_SESSION_TX_PARAM_SETUP = RADIOLIB_LW_SESSION_RX_TIMING_SETUP + MacTable[RADIOLIB_LW_MAC_RX_TIMING_SETUP].lenDn, // 1 byte
RADIOLIB_LW_SESSION_ADR_PARAM_SETUP = RADIOLIB_LW_SESSION_TX_PARAM_SETUP + MacTable[RADIOLIB_LW_MAC_TX_PARAM_SETUP].lenDn, // 1 byte
RADIOLIB_LW_SESSION_REJOIN_PARAM_SETUP = RADIOLIB_LW_SESSION_ADR_PARAM_SETUP + MacTable[RADIOLIB_LW_MAC_ADR_PARAM_SETUP].lenDn, // 1 byte
RADIOLIB_LW_SESSION_BEACON_FREQ = RADIOLIB_LW_SESSION_REJOIN_PARAM_SETUP + MacTable[RADIOLIB_LW_MAC_REJOIN_PARAM_SETUP].lenDn, // 3 bytes
RADIOLIB_LW_SESSION_PING_SLOT_CHANNEL = RADIOLIB_LW_SESSION_BEACON_FREQ + 3, // 4 bytes
RADIOLIB_LW_SESSION_PERIODICITY = RADIOLIB_LW_SESSION_PING_SLOT_CHANNEL + 4, // 1 byte
RADIOLIB_LW_SESSION_LAST_TIME = RADIOLIB_LW_SESSION_PERIODICITY + 1, // 4 bytes
RADIOLIB_LW_SESSION_UL_CHANNELS = RADIOLIB_LW_SESSION_LAST_TIME + 4, // 16*5 bytes
RADIOLIB_LW_SESSION_DL_CHANNELS = RADIOLIB_LW_SESSION_UL_CHANNELS + 16*MacTable[RADIOLIB_LW_MAC_NEW_CHANNEL].lenDn, // 16*4 bytes
RADIOLIB_LW_SESSION_MAC_QUEUE_UL = RADIOLIB_LW_SESSION_DL_CHANNELS + 16*MacTable[RADIOLIB_LW_MAC_DL_CHANNEL].lenDn, // 9*8+2 bytes
RADIOLIB_LW_SESSION_N_FCNT_DOWN = RADIOLIB_LW_SESSION_MAC_QUEUE_UL + sizeof(LoRaWANMacCommandQueue_t), // 4 bytes
RADIOLIB_LW_SESSION_ADR_FCNT = RADIOLIB_LW_SESSION_N_FCNT_DOWN + sizeof(uint32_t), // 4 bytes
RADIOLIB_LW_SESSION_LINK_ADR = RADIOLIB_LW_SESSION_ADR_FCNT + sizeof(uint32_t), // 4 bytes
RADIOLIB_LW_SESSION_FCNT_UP = RADIOLIB_LW_SESSION_LINK_ADR + MacTable[RADIOLIB_LW_MAC_LINK_ADR].lenDn, // 4 bytes
RADIOLIB_LW_SESSION_SIGNATURE = RADIOLIB_LW_SESSION_FCNT_UP + sizeof(uint32_t), // 2 bytes
RADIOLIB_LW_SESSION_BUF_SIZE = RADIOLIB_LW_SESSION_SIGNATURE + sizeof(uint16_t) // Session buffer size
};
/*!
@ -342,7 +342,7 @@ struct LoRaWANChannel_t {
};
// alias for unused channel
#define RADIOLIB_LORAWAN_CHANNEL_NONE { .enabled = false, .idx = RADIOLIB_LORAWAN_CHANNEL_INDEX_NONE, .freq = 0, .drMin = 0, .drMax = 0 }
#define RADIOLIB_LW_CHANNEL_NONE { .enabled = false, .idx = RADIOLIB_LW_CHANNEL_INDEX_NONE, .freq = 0, .drMin = 0, .drMax = 0 }
/*!
\struct LoRaWANChannelSpan_t
@ -370,7 +370,7 @@ struct LoRaWANChannelSpan_t {
};
// alias for unused channel span
#define RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE { .numChannels = 0, .freqStart = 0, .freqStep = 0, .drMin = 0, .drMax = 0, .joinRequestDataRate = RADIOLIB_LORAWAN_DATA_RATE_UNUSED }
#define RADIOLIB_LW_CHANNEL_SPAN_NONE { .numChannels = 0, .freqStart = 0, .freqStep = 0, .drMin = 0, .drMax = 0, .joinRequestDataRate = RADIOLIB_LW_DATA_RATE_UNUSED }
/*!
\struct LoRaWANBand_t
@ -384,7 +384,7 @@ struct LoRaWANBand_t {
uint8_t bandType;
/*! \brief Array of allowed maximum payload lengths for each data rate */
uint8_t payloadLenMax[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
uint8_t payloadLenMax[RADIOLIB_LW_CHANNEL_NUM_DATARATES];
/*! \brief Maximum allowed output power in this band in dBm */
int8_t powerMax;
@ -423,7 +423,7 @@ struct LoRaWANBand_t {
LoRaWANChannel_t rx2;
/*! \brief The corresponding datarates, bandwidths and coding rates for DR index */
uint8_t dataRates[RADIOLIB_LORAWAN_CHANNEL_NUM_DATARATES];
uint8_t dataRates[RADIOLIB_LW_CHANNEL_NUM_DATARATES];
};
// supported bands
@ -455,7 +455,7 @@ enum LoRaWANBandNum_t {
};
// provide easy access to the number of currently supported bands
#define RADIOLIB_LORAWAN_NUM_SUPPORTED_BANDS (BandLast - BandEU868)
#define RADIOLIB_LW_NUM_SUPPORTED_BANDS (BandLast - BandEU868)
// array of currently supported bands
extern const LoRaWANBand_t* LoRaWANBands[];
@ -465,7 +465,7 @@ extern const LoRaWANBand_t* LoRaWANBands[];
\brief Structure to save extra information about uplink/downlink event.
*/
struct LoRaWANEvent_t {
/*! \brief Event direction, one of RADIOLIB_LORAWAN_CHANNEL_DIR_* */
/*! \brief Event direction, one of RADIOLIB_LW_CHANNEL_DIR_* */
uint8_t dir;
/*! \brief Whether the event is confirmed or not (e.g., confirmed uplink sent by user application) */
@ -520,7 +520,7 @@ class LoRaWANNode {
/*!
\brief Returns the pointer to the internal buffer that holds the LW base parameters
\returns Pointer to uint8_t array of size RADIOLIB_LORAWAN_NONCES_BUF_SIZE
\returns Pointer to uint8_t array of size RADIOLIB_LW_NONCES_BUF_SIZE
*/
uint8_t* getBufferNonces();
@ -533,7 +533,7 @@ class LoRaWANNode {
/*!
\brief Returns the pointer to the internal buffer that holds the LW session parameters
\returns Pointer to uint8_t array of size RADIOLIB_LORAWAN_SESSION_BUF_SIZE
\returns Pointer to uint8_t array of size RADIOLIB_LW_SESSION_BUF_SIZE
*/
uint8_t* getBufferSession();
@ -561,7 +561,7 @@ class LoRaWANNode {
\param joinDr The datarate at which to send the join-request and any subsequent uplinks (unless ADR is enabled)
\returns \ref status_codes
*/
int16_t beginOTAA(uint64_t joinEUI, uint64_t devEUI, uint8_t* nwkKey, uint8_t* appKey, bool force = false, uint8_t joinDr = RADIOLIB_LORAWAN_DATA_RATE_UNUSED);
int16_t beginOTAA(uint64_t joinEUI, uint64_t devEUI, uint8_t* nwkKey, uint8_t* appKey, bool force = false, uint8_t joinDr = RADIOLIB_LW_DATA_RATE_UNUSED);
/*!
\brief Join network by performing activation by personalization.
@ -576,7 +576,7 @@ class LoRaWANNode {
\param initialDr The datarate at which to send the first uplink and any subsequent uplinks (unless ADR is enabled)
\returns \ref status_codes
*/
int16_t beginABP(uint32_t addr, uint8_t* fNwkSIntKey, uint8_t* sNwkSIntKey, uint8_t* nwkSEncKey, uint8_t* appSKey, bool force = false, uint8_t initialDr = RADIOLIB_LORAWAN_DATA_RATE_UNUSED);
int16_t beginABP(uint32_t addr, uint8_t* fNwkSIntKey, uint8_t* sNwkSIntKey, uint8_t* nwkSEncKey, uint8_t* appSKey, bool force = false, uint8_t initialDr = RADIOLIB_LW_DATA_RATE_UNUSED);
/*! \brief Whether there is an ongoing session active */
bool isJoined();
@ -853,10 +853,10 @@ class LoRaWANNode {
void beginCommon(uint8_t initialDr);
// a buffer that holds all LW base parameters that should persist at all times!
uint8_t bufferNonces[RADIOLIB_LORAWAN_NONCES_BUF_SIZE] = { 0 };
uint8_t bufferNonces[RADIOLIB_LW_NONCES_BUF_SIZE] = { 0 };
// a buffer that holds all LW session parameters that preferably persist, but can be afforded to get lost
uint8_t bufferSession[RADIOLIB_LORAWAN_SESSION_BUF_SIZE] = { 0 };
uint8_t bufferSession[RADIOLIB_LW_SESSION_BUF_SIZE] = { 0 };
LoRaWANMacCommandQueue_t commandsUp = {
.numCommands = 0,
@ -884,23 +884,23 @@ class LoRaWANNode {
// session-specific parameters
uint32_t homeNetId = 0;
uint8_t adrLimitExp = RADIOLIB_LORAWAN_ADR_ACK_LIMIT_EXP;
uint8_t adrDelayExp = RADIOLIB_LORAWAN_ADR_ACK_DELAY_EXP;
uint8_t adrLimitExp = RADIOLIB_LW_ADR_ACK_LIMIT_EXP;
uint8_t adrDelayExp = RADIOLIB_LW_ADR_ACK_DELAY_EXP;
uint8_t nbTrans = 1; // Number of allowed frame retransmissions
uint8_t txPowerCur = 0;
uint8_t txPowerMax = 0;
uint32_t fcntUp = 0;
uint32_t aFcntDown = 0;
uint32_t nFcntDown = 0;
uint32_t confFcntUp = RADIOLIB_LORAWAN_FCNT_NONE;
uint32_t confFcntDown = RADIOLIB_LORAWAN_FCNT_NONE;
uint32_t confFcntUp = RADIOLIB_LW_FCNT_NONE;
uint32_t confFcntDown = RADIOLIB_LW_FCNT_NONE;
uint32_t adrFcnt = 0;
// whether the current configured channel is in FSK mode
bool FSK = false;
// flag that shows whether the device is joined and there is an ongoing session (none, ABP or OTAA)
uint16_t activeMode = RADIOLIB_LORAWAN_MODE_NONE;
uint16_t activeMode = RADIOLIB_LW_MODE_NONE;
// ADR is enabled by default
bool adrEnabled = true;
@ -927,13 +927,13 @@ class LoRaWANNode {
uint8_t difsSlots;
// available channel frequencies from list passed during OTA activation
LoRaWANChannel_t availableChannels[2][RADIOLIB_LORAWAN_NUM_AVAILABLE_CHANNELS];
LoRaWANChannel_t availableChannels[2][RADIOLIB_LW_NUM_AVAILABLE_CHANNELS];
// currently configured channels for TX and RX1
LoRaWANChannel_t currentChannels[2] = { RADIOLIB_LORAWAN_CHANNEL_NONE, RADIOLIB_LORAWAN_CHANNEL_NONE };
LoRaWANChannel_t currentChannels[2] = { RADIOLIB_LW_CHANNEL_NONE, RADIOLIB_LW_CHANNEL_NONE };
// currently configured datarates for TX and RX1
uint8_t dataRates[2] = { RADIOLIB_LORAWAN_DATA_RATE_UNUSED, RADIOLIB_LORAWAN_DATA_RATE_UNUSED };
uint8_t dataRates[2] = { RADIOLIB_LW_DATA_RATE_UNUSED, RADIOLIB_LW_DATA_RATE_UNUSED };
// LoRaWAN revision (1.0 vs 1.1)
uint8_t rev = 0;
@ -948,7 +948,7 @@ class LoRaWANNode {
RadioLibTime_t rxDelayEnd = 0;
// delays between the uplink and RX1/2 windows
RadioLibTime_t rxDelays[2] = { RADIOLIB_LORAWAN_RECEIVE_DELAY_1_MS, RADIOLIB_LORAWAN_RECEIVE_DELAY_2_MS };
RadioLibTime_t rxDelays[2] = { RADIOLIB_LW_RECEIVE_DELAY_1_MS, RADIOLIB_LW_RECEIVE_DELAY_2_MS };
// device status - battery level
uint8_t battLevel = 0xFF;

View file

@ -3,7 +3,7 @@
#if !RADIOLIB_EXCLUDE_LORAWAN
// array of pointers to currently supported LoRaWAN bands
const LoRaWANBand_t* LoRaWANBands[RADIOLIB_LORAWAN_NUM_SUPPORTED_BANDS] = {
const LoRaWANBand_t* LoRaWANBands[RADIOLIB_LW_NUM_SUPPORTED_BANDS] = {
&EU868,
&US915,
&CN780,
@ -17,7 +17,7 @@ const LoRaWANBand_t* LoRaWANBands[RADIOLIB_LORAWAN_NUM_SUPPORTED_BANDS] = {
const LoRaWANBand_t EU868 = {
.bandNum = BandEU868,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.bandType = RADIOLIB_LW_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 16,
.powerNumSteps = 7,
@ -30,55 +30,55 @@ const LoRaWANBand_t EU868 = {
{ .enabled = true, .idx = 2, .freq = 868.500, .drMin = 0, .drMax = 5},
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
RADIOLIB_LW_CHANNEL_SPAN_NONE,
RADIOLIB_LW_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1Span = RADIOLIB_LW_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 869.525, .drMin = 0, .drMax = 0 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_250_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_FSK_50_K,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};
const LoRaWANBand_t US915 = {
.bandNum = BandUS915,
.bandType = RADIOLIB_LORAWAN_BAND_FIXED,
.bandType = RADIOLIB_LW_BAND_FIXED,
.payloadLenMax = { 19, 61, 133, 250, 250, 0, 0, 0, 41, 117, 230, 230, 230, 230, 0 },
.powerMax = 30,
.powerNumSteps = 10,
.dutyCycle = 0,
.dwellTimeUp = RADIOLIB_LORAWAN_DWELL_TIME,
.dwellTimeUp = RADIOLIB_LW_DWELL_TIME,
.dwellTimeDn = 0,
.txFreqs = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.numTxSpans = 2,
.txSpans = {
@ -105,32 +105,32 @@ const LoRaWANBand_t US915 = {
.freqStep = 0.600,
.drMin = 8,
.drMax = 13,
.joinRequestDataRate = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
.joinRequestDataRate = RADIOLIB_LW_DATA_RATE_UNUSED
},
.rx1DataRateBase = 10,
.rx2 = { .enabled = true, .idx = 0, .freq = 923.300, .drMin = 8, .drMax = 8 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};
const LoRaWANBand_t CN780 = {
.bandNum = BandCN780,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.bandType = RADIOLIB_LW_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 250, 230, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 12,
.powerNumSteps = 5,
@ -149,34 +149,34 @@ const LoRaWANBand_t CN780 = {
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
RADIOLIB_LW_CHANNEL_SPAN_NONE,
RADIOLIB_LW_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1Span = RADIOLIB_LW_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 786.000, .drMin = 0, .drMax = 0 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_250_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_FSK_50_K,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};
const LoRaWANBand_t EU433 = {
.bandNum = BandEU433,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.bandType = RADIOLIB_LW_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 12,
.powerNumSteps = 5,
@ -189,40 +189,40 @@ const LoRaWANBand_t EU433 = {
{ .enabled = true, .idx = 2, .freq = 433.575, .drMin = 0, .drMax = 5},
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
RADIOLIB_LW_CHANNEL_SPAN_NONE,
RADIOLIB_LW_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1Span = RADIOLIB_LW_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 434.665, .drMin = 0, .drMax = 0 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_250_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_FSK_50_K,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};
const LoRaWANBand_t AU915 = {
.bandNum = BandAU915,
.bandType = RADIOLIB_LORAWAN_BAND_FIXED,
.bandType = RADIOLIB_LW_BAND_FIXED,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 230, 0, 41, 117, 230, 230, 230, 230, 0 },
.powerMax = 30,
.powerNumSteps = 10,
@ -230,14 +230,14 @@ const LoRaWANBand_t AU915 = {
.dwellTimeUp = 0,
.dwellTimeDn = 0,
.txFreqs = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.numTxSpans = 2,
.txSpans = {
@ -264,32 +264,32 @@ const LoRaWANBand_t AU915 = {
.freqStep = 0.600,
.drMin = 8,
.drMax = 13,
.joinRequestDataRate = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
.joinRequestDataRate = RADIOLIB_LW_DATA_RATE_UNUSED
},
.rx1DataRateBase = 8,
.rx2 = { .enabled = true, .idx = 0, .freq = 923.300, .drMin = 8, .drMax = 8 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_500_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_500_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};
const LoRaWANBand_t CN500 = {
.bandNum = BandCN500,
.bandType = RADIOLIB_LORAWAN_BAND_FIXED,
.bandType = RADIOLIB_LW_BAND_FIXED,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 19,
.powerNumSteps = 7,
@ -297,14 +297,14 @@ const LoRaWANBand_t CN500 = {
.dwellTimeUp = 0,
.dwellTimeDn = 0,
.txFreqs = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.numTxSpans = 1,
.txSpans = {
@ -316,7 +316,7 @@ const LoRaWANBand_t CN500 = {
.drMax = 5,
.joinRequestDataRate = 0
},
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
RADIOLIB_LW_CHANNEL_SPAN_NONE
},
.rx1Span = {
.numChannels = 48,
@ -324,78 +324,78 @@ const LoRaWANBand_t CN500 = {
.freqStep = 0.200,
.drMin = 0,
.drMax = 5,
.joinRequestDataRate = RADIOLIB_LORAWAN_DATA_RATE_UNUSED
.joinRequestDataRate = RADIOLIB_LW_DATA_RATE_UNUSED
},
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 505.300, .drMin = 0, .drMax = 0 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_5,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_5,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};
const LoRaWANBand_t AS923 = {
.bandNum = BandAS923,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.bandType = RADIOLIB_LW_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 16,
.powerNumSteps = 7,
.dutyCycle = 36000,
.dwellTimeUp = RADIOLIB_LORAWAN_DWELL_TIME,
.dwellTimeDn = RADIOLIB_LORAWAN_DWELL_TIME,
.dwellTimeUp = RADIOLIB_LW_DWELL_TIME,
.dwellTimeDn = RADIOLIB_LW_DWELL_TIME,
.txFreqs = {
{ .enabled = true, .idx = 0, .freq = 923.200, .drMin = 0, .drMax = 5},
{ .enabled = true, .idx = 1, .freq = 923.400, .drMin = 0, .drMax = 5},
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
RADIOLIB_LW_CHANNEL_SPAN_NONE,
RADIOLIB_LW_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1Span = RADIOLIB_LW_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 923.200, .drMin = 2, .drMax = 2 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_250_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_250_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_FSK_50_K,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};
const LoRaWANBand_t KR920 = {
.bandNum = BandKR920,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.bandType = RADIOLIB_LW_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 14,
.powerNumSteps = 7,
@ -408,40 +408,40 @@ const LoRaWANBand_t KR920 = {
{ .enabled = true, .idx = 2, .freq = 922.500, .drMin = 0, .drMax = 5}
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
RADIOLIB_LW_CHANNEL_SPAN_NONE,
RADIOLIB_LW_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1Span = RADIOLIB_LW_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 921.900, .drMin = 0, .drMax = 0 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};
const LoRaWANBand_t IN865 = {
.bandNum = BandIN865,
.bandType = RADIOLIB_LORAWAN_BAND_DYNAMIC,
.bandType = RADIOLIB_LW_BAND_DYNAMIC,
.payloadLenMax = { 59, 59, 59, 123, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0 },
.powerMax = 30,
.powerNumSteps = 10,
@ -454,34 +454,34 @@ const LoRaWANBand_t IN865 = {
{ .enabled = true, .idx = 2, .freq = 865.9850, .drMin = 0, .drMax = 5}
},
.txJoinReq = {
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE,
RADIOLIB_LORAWAN_CHANNEL_NONE
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE,
RADIOLIB_LW_CHANNEL_NONE
},
.numTxSpans = 0,
.txSpans = {
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE
RADIOLIB_LW_CHANNEL_SPAN_NONE,
RADIOLIB_LW_CHANNEL_SPAN_NONE
},
.rx1Span = RADIOLIB_LORAWAN_CHANNEL_SPAN_NONE,
.rx1Span = RADIOLIB_LW_CHANNEL_SPAN_NONE,
.rx1DataRateBase = 0,
.rx2 = { .enabled = true, .idx = 0, .freq = 866.550, .drMin = 2, .drMax = 2 },
.dataRates = {
RADIOLIB_LORAWAN_DATA_RATE_SF_12 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_11 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_10 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_9 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_8 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_SF_7 | RADIOLIB_LORAWAN_DATA_RATE_BW_125_KHZ | RADIOLIB_LORAWAN_DATA_RATE_CR_4_7,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_FSK_50_K,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED,
RADIOLIB_LORAWAN_DATA_RATE_UNUSED
RADIOLIB_LW_DATA_RATE_SF_12 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_11 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_10 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_9 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_8 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_SF_7 | RADIOLIB_LW_DATA_RATE_BW_125_KHZ | RADIOLIB_LW_DATA_RATE_CR_4_7,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_FSK_50_K,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED,
RADIOLIB_LW_DATA_RATE_UNUSED
}
};