LoRaWANCH341 Library
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
LoRaWAN Class Reference

Class that provides LoRaWAN protocol implementation. More...

#include <LoRaWAN.hpp>

Collaboration diagram for LoRaWAN:
Collaboration graph

Classes

struct  Impl
 
struct  Message
 Structure representing a LoRaWAN message. More...
 

Public Types

enum  Region {
  REGION_EU868 = 0 , REGION_US915 , REGION_AU915 , REGION_EU433 ,
  REGIONS
}
 LoRaWAN supported regions. More...
 
enum  DeviceClass { CLASS_A , CLASS_B , CLASS_C }
 LoRaWAN device classes. More...
 
enum  JoinMode { OTAA , ABP }
 LoRaWAN join modes. More...
 
enum  ConfirmationState { NONE , WAITING_ACK , ACK_PENDING }
 Represents the state of message confirmations. More...
 
enum  RxWindowState {
  RX_IDLE , RX_WAIT_1 , RX_WINDOW_1 , RX_WAIT_2 ,
  RX_WINDOW_2 , RX_CONTINUOUS
}
 Represents the state of receive windows. More...
 
typedef std::function< void(const Message &)> ReceiveCallback
 Callback type for received messages.
 
typedef std::function< void(bool)> JoinCallback
 Callback type for join events.
 

Public Member Functions

 LoRaWAN ()
 Default constructor.
 
 LoRaWAN (std::unique_ptr< SPIInterface > spi_interface)
 Constructor with custom SPI interface.
 
 ~LoRaWAN ()
 Destructor.
 
bool init (int deviceIndex=0)
 Initialize the LoRaWAN stack and radio.
 
void setDeviceClass (DeviceClass deviceClass)
 Set the device class (A, B, or C).
 
void setDevEUI (const std::string &devEUI)
 Set the Device EUI.
 
void setAppEUI (const std::string &appEUI)
 Set the Application EUI.
 
void setAppKey (const std::string &appKey)
 Set the Application Key.
 
void setDevAddr (const std::string &devAddr)
 Set the Device Address.
 
void setNwkSKey (const std::string &nwkSKey)
 Set the Network Session Key.
 
void setAppSKey (const std::string &appSKey)
 Set the Application Session Key.
 
bool join (JoinMode mode, unsigned long timeout=10000)
 Join a LoRaWAN network.
 
std::vector< uint8_t > encryptPayload (const std::vector< uint8_t > &payload, uint8_t port)
 Encrypt a payload.
 
std::vector< uint8_t > decryptPayload (const std::vector< uint8_t > &payload, uint8_t port)
 Decrypt a payload.
 
float calculateTimeOnAir (size_t payload_size)
 Calculate the time on air for a payload.
 
bool checkDutyCycle (float frequency, size_t payload_size)
 Check if duty cycle allows transmission.
 
float getDutyCycleUsage (int channel)
 Get the duty cycle usage for a channel.
 
void resetDutyCycle ()
 Reset the duty cycle usage.
 
bool send (const std::vector< uint8_t > &data, uint8_t port, bool confirmed=false, bool force_duty_cycle=false)
 Send a message.
 
void update ()
 Update the LoRaWAN state.
 
bool receive (Message &message, unsigned long timeout=1000)
 Receive a message.
 
void onReceive (std::function< void(const Message &)> callback)
 Set a callback for received messages.
 
void onJoin (std::function< void(bool)> callback)
 Set a callback for join events.
 
void setRegion (int region)
 Set the LoRaWAN region.
 
int getRegion () const
 Get the current LoRaWAN region.
 
float getFrequency () const
 Get the current frequency.
 
void setFrequency (float freq_mhz)
 Set the frequency.
 
int getChannelFromFrequency (float freq_mhz) const
 Get the channel from a frequency.
 
float getFrequencyFromChannel (int channel) const
 Get the frequency for a channel.
 
void setChannel (uint8_t channel)
 Set the current channel.
 
uint8_t getChannel () const
 Get the current channel.
 
void setSingleChannel (bool enable, float freq_mhz=868.1, int sf=9, int bw=125, int cr=5, int power=14, int preamble=8)
 Enable or disable single channel mode.
 
bool getSingleChannel () const
 Check if single channel mode is enabled.
 
float getSingleChannelFrequency () const
 Get the single channel frequency.
 
void setTxPower (int8_t power)
 Set the transmission power.
 
int getRSSI () const
 Get the RSSI (Received Signal Strength Indicator).
 
int getSNR () const
 Get the SNR (Signal-to-Noise Ratio).
 
uint32_t getFrameCounter () const
 Get the frame counter.
 
void setFrameCounter (uint32_t counter)
 Set the frame counter.
 
void wake ()
 Wake the radio from sleep mode.
 
void sleep ()
 Put the radio in sleep mode.
 
bool validateKeys () const
 Validate the session keys.
 
void enableADR (bool enable)
 Enable or disable ADR (Adaptive Data Rate).
 
bool isADREnabled () const
 Check if ADR is enabled.
 
void resetSession ()
 Reset the LoRaWAN session.
 
void applyADRSettings (uint8_t dataRate, uint8_t txPower, const std::vector< uint8_t > &channelMask)
 Apply ADR settings.
 
void processMACCommands (const std::vector< uint8_t > &commands, std::vector< uint8_t > &response)
 Process MAC commands.
 
void processLinkADRReq (const std::vector< uint8_t > &cmd, size_t index, std::vector< uint8_t > &response)
 Process LinkADRReq MAC command.
 
void sendADRStatistics ()
 Send ADR statistics.
 
void updateTxParamsForADR ()
 Update transmission parameters for ADR.
 
void setupRxWindows ()
 Set up receive windows.
 
void openRX1Window ()
 Open RX1 window.
 
void openRX2Window ()
 Open RX2 window.
 
void updateRxWindows ()
 Update receive windows.
 
void handleConfirmation ()
 Handle confirmations.
 
void sendAck ()
 Send an acknowledgment.
 
void resetConfirmationState ()
 Reset the confirmation state.
 
void handleReceivedMessage (const std::vector< uint8_t > &payload, Message &msg)
 Handle a received message.
 
bool processJoinAccept (const std::vector< uint8_t > &data)
 Process a join accept message.
 
void requestLinkCheck ()
 Request a link check.
 
void updateDataRateFromSF ()
 Update the data rate from the spreading factor.
 

Static Public Member Functions

static void setVerbose (bool verbose)
 Set verbose mode.
 
static bool getVerbose ()
 Get verbose mode.
 

Private Attributes

std::unique_ptr< Implpimpl
 
int current_sf
 
float current_bw
 
int current_cr
 
int current_preamble
 
int current_power
 
int current_channel
 
int current_lna
 
int current_sync_word
 
uint8_t current_nbRep
 
uint8_t rx1DrOffset = 0
 
uint8_t rx2DataRate = 0
 
bool joined
 
DeviceClass currentClass
 
JoinMode joinMode
 
bool adrEnabled
 
uint8_t adrAckCounter
 
std::vector< uint8_t > pendingMACResponses
 
ConfirmationState confirmState = NONE
 
int confirmRetries = 0
 
std::chrono::steady_clock::time_point lastConfirmAttempt
 
std::vector< uint8_t > pendingAck
 
uint8_t ackPort
 
bool needsAck = false
 
uint16_t lastFcntDown = 0
 
float channelFrequencies [MAX_CHANNELS]
 
std::chrono::steady_clock::time_point lastChannelUse [MAX_CHANNELS]
 
float channelAirTime [MAX_CHANNELS]
 
int lora_region = REGION_EU868
 
bool one_channel_gateway = false
 
float one_channel_freq = 868.1
 
int one_channel_sf = 9
 
int one_channel_bw = 125
 
int one_channel_cr = 5
 
int one_channel_power = 14
 
int one_channel_preamble = 8
 
ReceiveCallback receiveCallback = nullptr
 
JoinCallback joinCallback = nullptr
 
uint8_t current_dr = 0
 

Static Private Attributes

static constexpr int MAX_CHANNELS = 16
 
static constexpr unsigned long RECEIVE_DELAY1 = 1000
 
static constexpr unsigned long RECEIVE_DELAY2 = 2000
 
static constexpr unsigned long WINDOW_DURATION = 500
 
static constexpr uint8_t ADR_ACK_LIMIT = 64
 
static constexpr uint8_t ADR_ACK_DELAY = 32
 
static constexpr uint8_t MAX_RETRIES = 8
 
static constexpr float BASE_FREQ [REGIONS]
 
static constexpr float CHANNEL_STEP [REGIONS]
 
static constexpr int MAX_POWER [REGIONS]
 
static constexpr float RX2_FREQ [REGIONS]
 
static constexpr int RX2_SF [REGIONS]
 
static constexpr float RX2_BW [REGIONS]
 
static constexpr int RX2_CR [REGIONS]
 
static constexpr int RX2_PREAMBLE [REGIONS]
 
static bool isVerbose = false
 

Detailed Description

Class that provides LoRaWAN protocol implementation.

The LoRaWAN class implements the LoRaWAN protocol for communications with LoRaWAN networks. It supports both OTAA and ABP activation methods, Class A and Class C device operation, and provides methods for sending and receiving messages, managing MAC commands, and controlling various radio parameters.

Member Typedef Documentation

◆ JoinCallback

typedef std::function<void(bool)> LoRaWAN::JoinCallback

Callback type for join events.

◆ ReceiveCallback

typedef std::function<void(const Message&)> LoRaWAN::ReceiveCallback

Callback type for received messages.

Member Enumeration Documentation

◆ ConfirmationState

Represents the state of message confirmations.

Enumerator
NONE 

No confirmation pending.

WAITING_ACK 

Waiting for acknowledgment of sent message.

ACK_PENDING 

Need to acknowledge a received message.

◆ DeviceClass

LoRaWAN device classes.

Enumerator
CLASS_A 

Class A device - lowest power consumption, bidirectional.

CLASS_B 

Class B device - synchronized beacons, bidirectional with scheduled receive slots.

CLASS_C 

Class C device - continuous receive, bidirectional with lowest latency.

◆ JoinMode

LoRaWAN join modes.

Enumerator
OTAA 

Over-The-Air Activation - dynamic session keys.

ABP 

Activation By Personalization - static session keys.

◆ Region

LoRaWAN supported regions.

Enumerator
REGION_EU868 

European Union 863-870 MHz band.

REGION_US915 

United States 902-928 MHz band.

REGION_AU915 

Australia 915-928 MHz band.

REGION_EU433 

European Union 433 MHz band.

REGIONS 

Number of regions.

◆ RxWindowState

Represents the state of receive windows.

Enumerator
RX_IDLE 

Not in a receive window.

RX_WAIT_1 

Waiting to open RX1 window.

RX_WINDOW_1 

In RX1 window.

RX_WAIT_2 

Waiting to open RX2 window.

RX_WINDOW_2 

In RX2 window.

RX_CONTINUOUS 

Continuous reception (Class C)

Constructor & Destructor Documentation

◆ LoRaWAN() [1/2]

LoRaWAN::LoRaWAN ( )

Default constructor.

Initializes a LoRaWAN instance with default SPI interface (CH341SPI).

◆ LoRaWAN() [2/2]

LoRaWAN::LoRaWAN ( std::unique_ptr< SPIInterface spi_interface)
explicit

Constructor with custom SPI interface.

Parameters
spi_interfaceA unique pointer to an SPIInterface implementation

◆ ~LoRaWAN()

LoRaWAN::~LoRaWAN ( )
default

Destructor.

Member Function Documentation

◆ applyADRSettings()

void LoRaWAN::applyADRSettings ( uint8_t  dataRate,
uint8_t  txPower,
const std::vector< uint8_t > &  channelMask 
)

Apply ADR settings.

Parameters
dataRateThe data rate index
txPowerThe transmission power index
channelMaskThe channel mask
Here is the call graph for this function:

◆ calculateTimeOnAir()

float LoRaWAN::calculateTimeOnAir ( size_t  payload_size)

Calculate the time on air for a payload.

Parameters
payload_sizeSize of the payload in bytes
Returns
Time on air in milliseconds
Here is the caller graph for this function:

◆ checkDutyCycle()

bool LoRaWAN::checkDutyCycle ( float  frequency,
size_t  payload_size 
)

Check if duty cycle allows transmission.

Parameters
frequencyFrequency in MHz
payload_sizeSize of the payload in bytes
Returns
true if transmission is allowed, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ decryptPayload()

std::vector< uint8_t > LoRaWAN::decryptPayload ( const std::vector< uint8_t > &  payload,
uint8_t  port 
)

Decrypt a payload.

Parameters
payloadThe encrypted payload
portThe port number
Returns
Decrypted payload
Here is the call graph for this function:
Here is the caller graph for this function:

◆ enableADR()

void LoRaWAN::enableADR ( bool  enable)

Enable or disable ADR (Adaptive Data Rate).

Parameters
enableWhether to enable ADR
Here is the caller graph for this function:

◆ encryptPayload()

std::vector< uint8_t > LoRaWAN::encryptPayload ( const std::vector< uint8_t > &  payload,
uint8_t  port 
)

Encrypt a payload.

Parameters
payloadThe payload to encrypt
portThe port number
Returns
Encrypted payload
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getChannel()

uint8_t LoRaWAN::getChannel ( ) const

Get the current channel.

Returns
The current channel index

◆ getChannelFromFrequency()

int LoRaWAN::getChannelFromFrequency ( float  freq_mhz) const

Get the channel from a frequency.

Parameters
freq_mhzThe frequency in MHz
Returns
The channel index, or -1 if not found
Here is the caller graph for this function:

◆ getDutyCycleUsage()

float LoRaWAN::getDutyCycleUsage ( int  channel)

Get the duty cycle usage for a channel.

Parameters
channelChannel index
Returns
Duty cycle usage as a percentage
Here is the caller graph for this function:

◆ getFrameCounter()

uint32_t LoRaWAN::getFrameCounter ( ) const

Get the frame counter.

Returns
The current uplink frame counter

◆ getFrequency()

float LoRaWAN::getFrequency ( ) const

Get the current frequency.

Returns
The current frequency in MHz
Here is the caller graph for this function:

◆ getFrequencyFromChannel()

float LoRaWAN::getFrequencyFromChannel ( int  channel) const

Get the frequency for a channel.

Parameters
channelThe channel index
Returns
The frequency in MHz, or 0 if invalid

◆ getRegion()

int LoRaWAN::getRegion ( ) const

Get the current LoRaWAN region.

Returns
The current region

◆ getRSSI()

int LoRaWAN::getRSSI ( ) const

Get the RSSI (Received Signal Strength Indicator).

Returns
The RSSI in dBm

◆ getSingleChannel()

bool LoRaWAN::getSingleChannel ( ) const

Check if single channel mode is enabled.

Returns
true if single channel mode is enabled, false otherwise

◆ getSingleChannelFrequency()

float LoRaWAN::getSingleChannelFrequency ( ) const

Get the single channel frequency.

Returns
The single channel frequency in MHz

◆ getSNR()

int LoRaWAN::getSNR ( ) const

Get the SNR (Signal-to-Noise Ratio).

Returns
The SNR in dB

◆ getVerbose()

static bool LoRaWAN::getVerbose ( )
inlinestatic

Get verbose mode.

Returns
true if verbose mode is enabled, false otherwise
Here is the caller graph for this function:

◆ handleConfirmation()

void LoRaWAN::handleConfirmation ( )

Handle confirmations.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handleReceivedMessage()

void LoRaWAN::handleReceivedMessage ( const std::vector< uint8_t > &  payload,
Message msg 
)

Handle a received message.

Parameters
payloadThe received payload
msgReference to a Message structure where the processed message will be stored
Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

bool LoRaWAN::init ( int  deviceIndex = 0)

Initialize the LoRaWAN stack and radio.

Parameters
deviceIndexOptional device index for SPI
Returns
true if initialization succeeded, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isADREnabled()

bool LoRaWAN::isADREnabled ( ) const

Check if ADR is enabled.

Returns
true if ADR is enabled, false otherwise

◆ join()

bool LoRaWAN::join ( JoinMode  mode,
unsigned long  timeout = 10000 
)

Join a LoRaWAN network.

Parameters
modeJoin mode (OTAA or ABP)
timeoutTimeout in milliseconds
Returns
true if join succeeded, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ onJoin()

void LoRaWAN::onJoin ( std::function< void(bool)>  callback)

Set a callback for join events.

Parameters
callbackFunction to call when a join event occurs

◆ onReceive()

void LoRaWAN::onReceive ( std::function< void(const Message &)>  callback)

Set a callback for received messages.

Parameters
callbackFunction to call when a message is received
Here is the caller graph for this function:

◆ openRX1Window()

void LoRaWAN::openRX1Window ( )

Open RX1 window.

Open the RX1 window (modified to use rx1DrOffset)

◆ openRX2Window()

void LoRaWAN::openRX2Window ( )

Open RX2 window.

Open the RX2 window (using custom rx2DataRate if configured)

Here is the caller graph for this function:

◆ processJoinAccept()

bool LoRaWAN::processJoinAccept ( const std::vector< uint8_t > &  data)

Process a join accept message.

Parameters
dataThe join accept message data
Returns
true if the processing succeeded, false otherwise
Here is the caller graph for this function:

◆ processLinkADRReq()

void LoRaWAN::processLinkADRReq ( const std::vector< uint8_t > &  cmd,
size_t  index,
std::vector< uint8_t > &  response 
)

Process LinkADRReq MAC command.

Parameters
cmdThe MAC command
indexThe index in the command
responseThe response MAC command
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processMACCommands()

void LoRaWAN::processMACCommands ( const std::vector< uint8_t > &  commands,
std::vector< uint8_t > &  response 
)

Process MAC commands.

Parameters
commandsThe MAC commands to process
responseThe response MAC commands
Here is the call graph for this function:
Here is the caller graph for this function:

◆ receive()

bool LoRaWAN::receive ( Message message,
unsigned long  timeout = 1000 
)

Receive a message.

Parameters
messageReference to a Message structure where the received message will be stored
timeoutTimeout in milliseconds
Returns
true if a message was received, false otherwise
Here is the call graph for this function:

◆ requestLinkCheck()

void LoRaWAN::requestLinkCheck ( )

Request a link check.

Request to server info about the device link quality.

Sends a MAC LinkCheckReq command to the server. The response will arrive in a future downlink with the margin and number of gateways that received the last uplink. The application must register a reception callback to process the response.

Returns
true if the command was scheduled correctly, false otherwise
Here is the caller graph for this function:

◆ resetConfirmationState()

void LoRaWAN::resetConfirmationState ( )

Reset the confirmation state.

Here is the caller graph for this function:

◆ resetDutyCycle()

void LoRaWAN::resetDutyCycle ( )

Reset the duty cycle usage.

◆ resetSession()

void LoRaWAN::resetSession ( )

Reset the LoRaWAN session.

Clears all session keys and counters.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ send()

bool LoRaWAN::send ( const std::vector< uint8_t > &  data,
uint8_t  port,
bool  confirmed = false,
bool  force_duty_cycle = false 
)

Send a message.

Parameters
dataThe payload to send
portThe port number
confirmedWhether the message should be confirmed
force_duty_cycleWhether to force transmission even if duty cycle limits are reached
Returns
true if the message was sent successfully, false otherwise
Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendAck()

void LoRaWAN::sendAck ( )

Send an acknowledgment.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sendADRStatistics()

void LoRaWAN::sendADRStatistics ( )

Send ADR statistics.

Here is the call graph for this function:

◆ setAppEUI()

void LoRaWAN::setAppEUI ( const std::string &  appEUI)

Set the Application EUI.

Parameters
appEUIApplication EUI as a hexadecimal string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAppKey()

void LoRaWAN::setAppKey ( const std::string &  appKey)

Set the Application Key.

Parameters
appKeyApplication Key as a hexadecimal string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setAppSKey()

void LoRaWAN::setAppSKey ( const std::string &  appSKey)

Set the Application Session Key.

Used for ABP activation.

Parameters
appSKeyApplication Session Key as a hexadecimal string

◆ setChannel()

void LoRaWAN::setChannel ( uint8_t  channel)

Set the current channel.

Parameters
channelThe channel index

◆ setDevAddr()

void LoRaWAN::setDevAddr ( const std::string &  devAddr)

Set the Device Address.

Used for ABP activation.

Parameters
devAddrDevice Address as a hexadecimal string

◆ setDevEUI()

void LoRaWAN::setDevEUI ( const std::string &  devEUI)

Set the Device EUI.

Parameters
devEUIDevice EUI as a hexadecimal string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setDeviceClass()

void LoRaWAN::setDeviceClass ( DeviceClass  deviceClass)

Set the device class (A, B, or C).

Parameters
deviceClassThe device class to set
Here is the caller graph for this function:

◆ setFrameCounter()

void LoRaWAN::setFrameCounter ( uint32_t  counter)

Set the frame counter.

Parameters
counterThe new frame counter value

◆ setFrequency()

void LoRaWAN::setFrequency ( float  freq_mhz)

Set the frequency.

Parameters
freq_mhzThe frequency in MHz
Here is the call graph for this function:

◆ setNwkSKey()

void LoRaWAN::setNwkSKey ( const std::string &  nwkSKey)

Set the Network Session Key.

Used for ABP activation.

Parameters
nwkSKeyNetwork Session Key as a hexadecimal string

◆ setRegion()

void LoRaWAN::setRegion ( int  region)

Set the LoRaWAN region.

Parameters
regionThe region to set

◆ setSingleChannel()

void LoRaWAN::setSingleChannel ( bool  enable,
float  freq_mhz = 868.1,
int  sf = 9,
int  bw = 125,
int  cr = 5,
int  power = 14,
int  preamble = 8 
)

Enable or disable single channel mode.

Parameters
enableWhether to enable single channel mode
freq_mhzThe frequency in MHz
sfSpreading factor (7-12)
bwBandwidth in kHz (125, 250, or 500)
crCoding rate (5-8 for 4/5 to 4/8)
powerTransmission power in dBm
preamblePreamble length
Here is the caller graph for this function:

◆ setTxPower()

void LoRaWAN::setTxPower ( int8_t  power)

Set the transmission power.

Parameters
powerThe transmission power in dBm

◆ setupRxWindows()

void LoRaWAN::setupRxWindows ( )

Set up receive windows.

Here is the caller graph for this function:

◆ setVerbose()

static void LoRaWAN::setVerbose ( bool  verbose)
inlinestatic

Set verbose mode.

Parameters
verboseWhether to enable verbose mode
Here is the caller graph for this function:

◆ sleep()

void LoRaWAN::sleep ( )

Put the radio in sleep mode.

◆ update()

void LoRaWAN::update ( )

Update the LoRaWAN state.

Should be called regularly to handle received messages and other events.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateDataRateFromSF()

void LoRaWAN::updateDataRateFromSF ( )

Update the data rate from the spreading factor.

Here is the caller graph for this function:

◆ updateRxWindows()

void LoRaWAN::updateRxWindows ( )

Update receive windows.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ updateTxParamsForADR()

void LoRaWAN::updateTxParamsForADR ( )

Update transmission parameters for ADR.

Here is the caller graph for this function:

◆ validateKeys()

bool LoRaWAN::validateKeys ( ) const

Validate the session keys.

Returns
true if the keys are valid, false otherwise
Here is the caller graph for this function:

◆ wake()

void LoRaWAN::wake ( )

Wake the radio from sleep mode.

Member Data Documentation

◆ ackPort

uint8_t LoRaWAN::ackPort
private

◆ ADR_ACK_DELAY

constexpr uint8_t LoRaWAN::ADR_ACK_DELAY = 32
staticconstexprprivate

◆ ADR_ACK_LIMIT

constexpr uint8_t LoRaWAN::ADR_ACK_LIMIT = 64
staticconstexprprivate

◆ adrAckCounter

uint8_t LoRaWAN::adrAckCounter
private

◆ adrEnabled

bool LoRaWAN::adrEnabled
private

◆ BASE_FREQ

constexpr float LoRaWAN::BASE_FREQ[REGIONS]
staticconstexprprivate
Initial value:
= {
868.1f,
902.3f,
915.2f,
433.175f
}

◆ CHANNEL_STEP

constexpr float LoRaWAN::CHANNEL_STEP[REGIONS]
staticconstexprprivate
Initial value:
= {
0.2f,
0.2f,
0.2f,
0.2f
}

◆ channelAirTime

float LoRaWAN::channelAirTime[MAX_CHANNELS]
private

◆ channelFrequencies

float LoRaWAN::channelFrequencies[MAX_CHANNELS]
private

◆ confirmRetries

int LoRaWAN::confirmRetries = 0
private

◆ confirmState

ConfirmationState LoRaWAN::confirmState = NONE
private

◆ current_bw

float LoRaWAN::current_bw
private

◆ current_channel

int LoRaWAN::current_channel
private

◆ current_cr

int LoRaWAN::current_cr
private

◆ current_dr

uint8_t LoRaWAN::current_dr = 0
private

◆ current_lna

int LoRaWAN::current_lna
private

◆ current_nbRep

uint8_t LoRaWAN::current_nbRep
private

◆ current_power

int LoRaWAN::current_power
private

◆ current_preamble

int LoRaWAN::current_preamble
private

◆ current_sf

int LoRaWAN::current_sf
private

◆ current_sync_word

int LoRaWAN::current_sync_word
private

◆ currentClass

DeviceClass LoRaWAN::currentClass
private

◆ isVerbose

bool LoRaWAN::isVerbose = false
staticprivate

◆ joinCallback

JoinCallback LoRaWAN::joinCallback = nullptr
private

◆ joined

bool LoRaWAN::joined
private

◆ joinMode

JoinMode LoRaWAN::joinMode
private

◆ lastChannelUse

std::chrono::steady_clock::time_point LoRaWAN::lastChannelUse[MAX_CHANNELS]
private

◆ lastConfirmAttempt

std::chrono::steady_clock::time_point LoRaWAN::lastConfirmAttempt
private

◆ lastFcntDown

uint16_t LoRaWAN::lastFcntDown = 0
private

◆ lora_region

int LoRaWAN::lora_region = REGION_EU868
private

◆ MAX_CHANNELS

constexpr int LoRaWAN::MAX_CHANNELS = 16
staticconstexprprivate

◆ MAX_POWER

constexpr int LoRaWAN::MAX_POWER[REGIONS]
staticconstexprprivate
Initial value:
= {
14,
30,
30,
14
}

◆ MAX_RETRIES

constexpr uint8_t LoRaWAN::MAX_RETRIES = 8
staticconstexprprivate

◆ needsAck

bool LoRaWAN::needsAck = false
private

◆ one_channel_bw

int LoRaWAN::one_channel_bw = 125
private

◆ one_channel_cr

int LoRaWAN::one_channel_cr = 5
private

◆ one_channel_freq

float LoRaWAN::one_channel_freq = 868.1
private

◆ one_channel_gateway

bool LoRaWAN::one_channel_gateway = false
private

◆ one_channel_power

int LoRaWAN::one_channel_power = 14
private

◆ one_channel_preamble

int LoRaWAN::one_channel_preamble = 8
private

◆ one_channel_sf

int LoRaWAN::one_channel_sf = 9
private

◆ pendingAck

std::vector<uint8_t> LoRaWAN::pendingAck
private

◆ pendingMACResponses

std::vector<uint8_t> LoRaWAN::pendingMACResponses
private

◆ pimpl

std::unique_ptr<Impl> LoRaWAN::pimpl
private

◆ RECEIVE_DELAY1

constexpr unsigned long LoRaWAN::RECEIVE_DELAY1 = 1000
staticconstexprprivate

◆ RECEIVE_DELAY2

constexpr unsigned long LoRaWAN::RECEIVE_DELAY2 = 2000
staticconstexprprivate

◆ receiveCallback

ReceiveCallback LoRaWAN::receiveCallback = nullptr
private

◆ rx1DrOffset

uint8_t LoRaWAN::rx1DrOffset = 0
private

◆ RX2_BW

constexpr float LoRaWAN::RX2_BW[REGIONS]
staticconstexprprivate
Initial value:
= {
125.0f,
500.0f,
500.0f,
125.0f
}

◆ RX2_CR

constexpr int LoRaWAN::RX2_CR[REGIONS]
staticconstexprprivate
Initial value:
= {
5,
5,
5,
5
}

◆ RX2_FREQ

constexpr float LoRaWAN::RX2_FREQ[REGIONS]
staticconstexprprivate
Initial value:
= {
869.525f,
923.3f,
923.3f,
434.665f
}

◆ RX2_PREAMBLE

constexpr int LoRaWAN::RX2_PREAMBLE[REGIONS]
staticconstexprprivate
Initial value:
= {
8,
8,
8,
8
}

◆ RX2_SF

constexpr int LoRaWAN::RX2_SF[REGIONS]
staticconstexprprivate
Initial value:
= {
9,
12,
12,
9
}

◆ rx2DataRate

uint8_t LoRaWAN::rx2DataRate = 0
private

◆ WINDOW_DURATION

constexpr unsigned long LoRaWAN::WINDOW_DURATION = 500
staticconstexprprivate

The documentation for this class was generated from the following files: