IoT Drivers  v3.3.0 (S2022)
Engineering in Software Technology
Basic LoRa driver functions

Commonly used LoRaWAN functions. Here you you will find the functions you normally will need. More...

Collaboration diagram for Basic LoRa driver functions:

Functions

uint8_t lora_driver_getMaxPayloadSize (void)
 Get max payload size in bytes. More...
 
lora_driver_returnCode_t lora_driver_setOtaaIdentity (char appEUI[17], char appKEY[33], char devEUI[17])
 Set identifiers and keys for a OTAA join. More...
 
lora_driver_returnCode_t lora_driver_configureToEu868 (void)
 Set the driver up to using EU868 standard. More...
 
char * lora_driver_mapReturnCodeToText (lora_driver_returnCode_t returnCode)
 Map a LoRa Driver return code into corresponding text. More...
 
lora_driver_returnCode_t lora_driver_setAbpIdentity (char nwkSKEY[33], char appSKEY[33], char devADD[9])
 Set identifiers and keys for a ABP join. More...
 
lora_driver_returnCode_t lora_driver_join (lora_driver_joinMode_t mode)
 Joins a LoRaWAN either with ABP or OTAA. More...
 
lora_driver_returnCode_t lora_driver_sendUploadMessage (bool confirmed, lora_driver_payload_t *payload)
 Send a upload message to the LoRaWAN. More...
 
lora_driver_returnCode_t lora_driver_getRn2483Hweui (char hwDevEUI[17])
 Get the RN2483 factory set devEUI. More...
 
lora_driver_returnCode_t lora_driver_rn2483GetVdd (char mv[5])
 Get the RN2483 modules supply voltage VDD. More...
 
lora_driver_returnCode_t lora_driver_rn2483Reboot (void)
 Reset the RN2483 module. More...
 
lora_driver_returnCode_t lora_driver_rn2483FactoryReset (void)
 Reset the RN2483 module. More...
 
lora_driver_returnCode_t lora_driver_saveMac (void)
 Save the set parameters into the EEPROM of the RN2483 module. More...
 

Detailed Description

Commonly used LoRaWAN functions. Here you you will find the functions you normally will need.

Function Documentation

◆ lora_driver_configureToEu868()

lora_driver_returnCode_t lora_driver_configureToEu868 ( void  )

Set the driver up to using EU868 standard.

The function sets the following parameters:

Parameter Channel Param 2 Note
mac rx2 frequency 869525000 Second receive window frequency
mac rx2 data rate 3 Second receive window data rate
mac ch drrange 1 min range 0 max range 6
mac ch dcycle 0-7 799
mac set ch freq 3 867100000
4 867300000
5 867500000
6 867700000
7 867900000
mac ch drrange 3-7 min range 0 max range 5
mac set ch status 3-7 on
mac set pwridx 1 1 The index value for the output power ( 1 = 14 dBm)
Note
This must be called before join with OTAA is carried out.
Returns
lora_driver_returnCode

◆ lora_driver_getMaxPayloadSize()

uint8_t lora_driver_getMaxPayloadSize ( void  )

Get max payload size in bytes.

The maximum allowed number of bytes that must be sent in the payload!

◆ lora_driver_getRn2483Hweui()

lora_driver_returnCode_t lora_driver_getRn2483Hweui ( char  hwDevEUI[17])

Get the RN2483 factory set devEUI.

This device ID is unique in time and space.

This hardware device ID is not automatically being used as the devEUI seen from the LoRaWAN. The later must be set using lora_driver_setOtaaIdentity or lora_driver_setDeviceIdentifier.

Parameters
[out]hwDevEUIbuffer where the hardware device ID will be returned.
Returns
lora_driver_returnCode

◆ lora_driver_join()

Joins a LoRaWAN either with ABP or OTAA.

Parameters
[in]modeLORA_OTAA or LORA_ABP
Returns
lora_driver_returnCode

◆ lora_driver_mapReturnCodeToText()

char* lora_driver_mapReturnCodeToText ( lora_driver_returnCode_t  returnCode)

Map a LoRa Driver return code into corresponding text.

Parameters
[in]returnCodeto be mapped to corresponding text.
See also
lora_driver_returnCodes
Returns
Text representation of return code.

◆ lora_driver_rn2483FactoryReset()

lora_driver_returnCode_t lora_driver_rn2483FactoryReset ( void  )

Reset the RN2483 module.

Reboots the module and restores all parameters to factory settings.

Note
I can't find a list of these default values.
Returns
lora_driver_returnCode

◆ lora_driver_rn2483GetVdd()

lora_driver_returnCode_t lora_driver_rn2483GetVdd ( char  mv[5])

Get the RN2483 modules supply voltage VDD.

Todo:
Implement lora_driver_rn2483GetVdd function!
Parameters
[out]mvbuffer where the VDD voltage will be returned [mv]
Returns
lora_driver_returnCode

◆ lora_driver_rn2483Reboot()

lora_driver_returnCode_t lora_driver_rn2483Reboot ( void  )

Reset the RN2483 module.

Reboots the module and automatically restores the last saved parameters set in the module. For a list of restored parameters see RN2483 LoRa Technology Module Command Reference User's Guide

Returns
lora_driver_returnCode

◆ lora_driver_saveMac()

lora_driver_returnCode_t lora_driver_saveMac ( void  )

Save the set parameters into the EEPROM of the RN2483 module.

For a list of restored parameters see RN2483 LoRa Technology Module Command Reference User's Guide

Returns
lora_driver_returnCode

◆ lora_driver_sendUploadMessage()

lora_driver_returnCode_t lora_driver_sendUploadMessage ( bool  confirmed,
lora_driver_payload_t payload 
)

Send a upload message to the LoRaWAN.

Parameters
[in]confirmedtrue: Send confirmed, else unconfirmed.
[in]payloadpointer to payload to be sent.
Returns
lora_driver_returnCode

◆ lora_driver_setAbpIdentity()

lora_driver_returnCode_t lora_driver_setAbpIdentity ( char  nwkSKEY[33],
char  appSKEY[33],
char  devADD[9] 
)

Set identifiers and keys for a ABP join.

To use Activation By Personalization (ABP) the following information is needed:

Name LoRaWAN name Length
Network Session Key NwkSKey 32 Hex digits
Application Session Key AppSKey 32 Hex digits
Device Address DevAddr 8 Hex digits

This function sets besides the identifiers and keys the following parameters in the module:

LoRaWan Parameter Value
Adaptive Data Rate ON
Note
This must be called before join with ABP is carried out.
These data are being stored in RN2384 module by this function.
Parameters
[in]nwkSKEYNetwork Session Key
[in]appSKEYApplication Session Key
[in]devADDDevice Address
Returns
lora_driver_returnCode

◆ lora_driver_setOtaaIdentity()

lora_driver_returnCode_t lora_driver_setOtaaIdentity ( char  appEUI[17],
char  appKEY[33],
char  devEUI[17] 
)

Set identifiers and keys for a OTAA join.

To use Over the Air Activation (OTAA) the following information is needed:

Name LoRaWAN name Length
Application Identifier AppEUI 16 Hex digits
Application Key AppKey 32 Hex digits
Device Identifier DevEUI 16 Hex digits

This function sets besides the identifiers and keys the following parameters in the module:

LoRaWan Parameter Value
Adaptive Data Rate ON
Note
This must be called before any join is carried out.
These data are being stored in RN2384 module by this function.
Parameters
appEUIApplication Identifier
appKEYApplication Key
devEUIApplication Key
Returns
lora_driver_returnCode