![]() |
IoT Drivers
v3.3.0 (S2022)
Engineering in Software Technology
|
Commonly used LoRaWAN functions. Here you you will find the functions you normally will need. More...
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... | |
Commonly used LoRaWAN functions. Here you you will find the functions you normally will need.
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) |
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_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.
[out] | hwDevEUI | buffer where the hardware device ID will be returned. |
lora_driver_returnCode_t lora_driver_join | ( | lora_driver_joinMode_t | mode | ) |
Joins a LoRaWAN either with ABP or OTAA.
[in] | mode | LORA_OTAA or LORA_ABP |
char* lora_driver_mapReturnCodeToText | ( | lora_driver_returnCode_t | returnCode | ) |
Map a LoRa Driver return code into corresponding text.
[in] | returnCode | to be mapped to corresponding text. |
lora_driver_returnCode_t lora_driver_rn2483FactoryReset | ( | void | ) |
Reset the RN2483 module.
Reboots the module and restores all parameters to factory settings.
lora_driver_returnCode_t lora_driver_rn2483GetVdd | ( | char | mv[5] | ) |
Get the RN2483 modules supply voltage VDD.
[out] | mv | buffer where the VDD voltage will be returned [mv] |
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
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
lora_driver_returnCode_t lora_driver_sendUploadMessage | ( | bool | confirmed, |
lora_driver_payload_t * | payload | ||
) |
Send a upload message to the LoRaWAN.
[in] | confirmed | true: Send confirmed, else unconfirmed. |
[in] | payload | pointer to payload to be sent. |
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 |
[in] | nwkSKEY | Network Session Key |
[in] | appSKEY | Application Session Key |
[in] | devADD | Device Address |
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 |
appEUI | Application Identifier |
appKEY | Application Key |
devEUI | Application Key |