RadioLib
Universal wireless communication library for Arduino
LoRaWANNode Class Reference

LoRaWAN-compatible node (class A device). More...

#include <LoRaWAN.h>

Public Member Functions

 LoRaWANNode (PhysicalLayer *phy, const LoRaWANBand_t *band)
 Default constructor. More...
 
void wipe ()
 Wipe internal persistent parameters. This will reset all counters and saved variables, so the device will have to rejoin the network.
 
int16_t begin ()
 Join network by loading information from persistent storage. More...
 
int16_t beginOTAA (uint64_t appEUI, uint64_t devEUI, uint8_t *nwkKey, uint8_t *appKey, bool force=false)
 Join network by performing over-the-air activation. By this procedure, the device will perform an exchange with the network server and set all necessary configuration. More...
 
int16_t beginAPB (uint32_t addr, uint8_t net, uint8_t *nwkSKey, uint8_t *appSKey)
 Join network by performing activation by personalization. In this procedure, all necessary configuration must be provided by the user. More...
 
int16_t uplink (const char *str, uint8_t port)
 Send a message to the server. More...
 
int16_t uplink (uint8_t *data, size_t len, uint8_t port)
 Send a message to the server. More...
 
int16_t configureChannel (uint8_t chan, uint8_t dr)
 Configure the radio to a given channel frequency and data rate. More...
 

Detailed Description

LoRaWAN-compatible node (class A device).

Constructor & Destructor Documentation

◆ LoRaWANNode()

LoRaWANNode::LoRaWANNode ( PhysicalLayer phy,
const LoRaWANBand_t band 
)

Default constructor.

Parameters
phyPointer to the PhysicalLayer radio module.
bandPointer to the LoRaWAN band to use.

Member Function Documentation

◆ begin()

int16_t LoRaWANNode::begin ( )

Join network by loading information from persistent storage.

Returns
Status Codes

◆ beginAPB()

int16_t LoRaWANNode::beginAPB ( uint32_t  addr,
uint8_t  net,
uint8_t *  nwkSKey,
uint8_t *  appSKey 
)

Join network by performing activation by personalization. In this procedure, all necessary configuration must be provided by the user.

Parameters
addrDevice address.
netNetwork ID.
nwkSKeyPointer to the network session AES-128 key.
appSKeyPointer to the application session AES-128 key.
Returns
Status Codes

◆ beginOTAA()

int16_t LoRaWANNode::beginOTAA ( uint64_t  appEUI,
uint64_t  devEUI,
uint8_t *  nwkKey,
uint8_t *  appKey,
bool  force = false 
)

Join network by performing over-the-air activation. By this procedure, the device will perform an exchange with the network server and set all necessary configuration.

Parameters
appEUI8-byte application identifier.
devEUI8-byte device identifier.
nwkKeyPointer to the network AES-128 key.
appKeyPointer to the application AES-128 key.
forceSet to true to force joining even if previously joined.
Returns
Status Codes

◆ configureChannel()

int16_t LoRaWANNode::configureChannel ( uint8_t  chan,
uint8_t  dr 
)

Configure the radio to a given channel frequency and data rate.

Parameters
chanChannel ID to set.
drData rate to set, DR0 - DR15.
Returns
Status Codes

◆ uplink() [1/2]

int16_t LoRaWANNode::uplink ( const char *  str,
uint8_t  port 
)

Send a message to the server.

Parameters
strC-string that will be transmitted.
portPort number to send the message to.
Returns
Status Codes

◆ uplink() [2/2]

int16_t LoRaWANNode::uplink ( uint8_t *  data,
size_t  len,
uint8_t  port 
)

Send a message to the server.

Parameters
dataData to send.
lenLength of the data.
portPort number to send the message to.
Returns
Status Codes

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