![]() |
SX126x-Arduino
1.2.1
|
#include "LoRaMacHelper.h"
#include "region/RegionCommon.h"
#include "system/utilities.h"
#include "mac/LoRaMacTest.h"
Functions | |
void | lmh_setDevEui (uint8_t userDevEui[]) |
void | lmh_setAppEui (uint8_t *userAppEui) |
Set Application IEEE EUI. More... | |
void | lmh_setAppKey (uint8_t *userAppKey) |
Set Application Key AES encryption/decryption cipher application key. More... | |
void | lmh_setNwkSKey (uint8_t *userNwkSKey) |
Set Network Session Key AES encryption/decryption cipher network session key. More... | |
void | lmh_setAppSKey (uint8_t *userAppSKey) |
Set Application Session Key AES encryption/decryption cipher application session key. More... | |
void | lmh_setDevAddr (uint32_t userDevAddr) |
Set Device address on the network (big endian) More... | |
void | lmh_setSingleChannelGateway (uint8_t userSingleChannel, int8_t userDatarate) |
Disable channel hoping for connnection to single channel gateways Check the file CHANNELS.MD to find out which channel corresponds to which frequency in a specific region Check the file Region.h to find out which datarate corresponds to which SF and bandwidth in a specific region. More... | |
bool | lmh_setSubBandChannels (uint8_t subBand) |
Set custom channel mask. More... | |
static bool | compliance_test_tx (void) |
static void | OnComplianceTestTxNextPacketTimerEvent (void) |
Function executed on TxNextPacket Timeout event. More... | |
static void | McpsConfirm (McpsConfirm_t *mcpsConfirm) |
MCPS-Confirm event function. More... | |
static void | McpsIndication (McpsIndication_t *mcpsIndication) |
MCPS-Indication event function. More... | |
static void | MlmeConfirm (MlmeConfirm_t *mlmeConfirm) |
MLME-Confirm event function. More... | |
lmh_error_status | lmh_init (lmh_callback_t *callbacks, lmh_param_t lora_param, bool otaa) |
Lora Initialisation. More... | |
void | lmh_datarate_set (uint8_t data_rate, uint8_t enable_adr) |
Configure data rate. More... | |
void | lmh_tx_power_set (uint8_t tx_power) |
Configure tx power. More... | |
void | lmh_join (void) |
Join a Lora Network in class A. More... | |
lmh_join_status | lmh_join_status_get (void) |
Check whether the Device is joined to the network. More... | |
lmh_error_status | lmh_send (lmh_app_data_t *app_data, lmh_confirm is_tx_confirmed) |
Send data. More... | |
lmh_error_status | lmh_class_request (DeviceClass_t newClass) |
change Lora Class More... | |
void | lmh_class_get (DeviceClass_t *currentClass) |
get the current Lora Class More... | |
uint32_t | lmh_getDevAddr (void) |
Returns the Device address set by the LoRaWan server after OTAA join success. More... | |
Variables | |
uint16_t | ChannelsMask [] |
uint16_t | ChannelsDefaultMask [] |
uint16_t | ChannelsMaskRemaining [] |
bool | _otaa = false |
bool | _dutyCycleEnabled = false |
static uint8_t | DevEui [] = LORAWAN_DEVICE_EUI |
static uint8_t | AppEui [] = LORAWAN_APPLICATION_EUI |
static uint8_t | AppKey [] = LORAWAN_APPLICATION_KEY |
static MlmeReqJoin_t | JoinParameters |
static uint8_t | NwkSKey [] = LORAWAN_NWKSKEY |
static uint8_t | AppSKey [] = LORAWAN_APPSKEY |
static uint32_t | DevAddr = LORAWAN_DEVICE_ADDRESS |
bool | singleChannelGateway = false |
uint8_t | singleChannelSelected = 0 |
int8_t | singleChannelDatarate = DR_3 |
static LoRaMacPrimitives_t | LoRaMacPrimitives |
static LoRaMacCallback_t | LoRaMacCallbacks |
static MibRequestConfirm_t | mibReq |
static lmh_param_t | m_param |
static lmh_callback_t * | m_callbacks |
static lmh_compliance_test_t | m_compliance_test |
static bool | m_adr_enable_init |
static TimerEvent_t | ComplianceTestTxNextPacketTimer |
static char | strlog1 [64] |
static char | strlog2 [64] |
static char | strlog3 [64] |
void lmh_setDevEui | ( | uint8_t | userDevEui[] | ) |
void lmh_setAppEui | ( | uint8_t * | userAppEui | ) |
Set Application IEEE EUI.
userAppEui | Application IEEE EUI as uint8_t[] * |
void lmh_setAppKey | ( | uint8_t * | userAppKey | ) |
Set Application Key AES encryption/decryption cipher application key.
userAppKey | Application Key as uint8_t[] * |
void lmh_setNwkSKey | ( | uint8_t * | userNwkSKey | ) |
Set Network Session Key AES encryption/decryption cipher network session key.
userNwkSKey | Network Session Key as uint8_t[] * |
void lmh_setAppSKey | ( | uint8_t * | userAppSKey | ) |
Set Application Session Key AES encryption/decryption cipher application session key.
userAppSKey | Application Session Key as uint8_t[] * |
void lmh_setDevAddr | ( | uint32_t | userDevAddr | ) |
Set Device address on the network (big endian)
userDevAddr | Device address as uint8_t[] * |
void lmh_setSingleChannelGateway | ( | uint8_t | userSingleChannel, |
int8_t | userDatarate | ||
) |
Disable channel hoping for connnection to single channel gateways Check the file CHANNELS.MD to find out which channel corresponds to which frequency in a specific region Check the file Region.h to find out which datarate corresponds to which SF and bandwidth in a specific region.
userSingleChannel | Channel to be used |
userDatarate | Datarate to be used |
bool lmh_setSubBandChannels | ( | uint8_t | subBand | ) |
Set custom channel mask.
subBand | Sub channel number 1 to 8 |
|
static |
|
static |
Function executed on TxNextPacket Timeout event.
|
static |
MCPS-Confirm event function.
mcpsConfirm | Pointer to the confirm structure, containing confirm attributes. |
|
static |
MCPS-Indication event function.
mcpsIndication | Pointer to the indication structure, containing indication attributes. |
|
static |
MLME-Confirm event function.
mlmeConfirm | Pointer to the confirm structure, containing confirm attributes. |
lmh_error_status lmh_init | ( | lmh_callback_t * | callbacks, |
lmh_param_t | lora_param, | ||
bool | otaa | ||
) |
Lora Initialisation.
callbacks | Pointer to structure containing the callback functions |
lora_param | Pointer to structure containing the parameters |
otaa | Choose OTAA (true) or ABP (false) activation |
error | status |
void lmh_datarate_set | ( | uint8_t | data_rate, |
uint8_t | enable_adr | ||
) |
Configure data rate.
data_rate | data rate |
enable_adr | enable adaptative data rate |
void lmh_tx_power_set | ( | uint8_t | tx_power | ) |
Configure tx power.
tx_power | tx power |
void lmh_join | ( | void | ) |
Join a Lora Network in class A.
lmh_join_status lmh_join_status_get | ( | void | ) |
Check whether the Device is joined to the network.
returns | LORAMACHELPER_SET if joined |
lmh_error_status lmh_send | ( | lmh_app_data_t * | app_data, |
lmh_confirm | is_txconfirmed | ||
) |
Send data.
app_data | Pointer to data structure to be sent |
is_txconfirmed | do we need confirmation? |
error | status |
lmh_error_status lmh_class_request | ( | DeviceClass_t | newClass | ) |
change Lora Class
newClass | DeviceClass_t NewClass |
LoraErrorStatus |
void lmh_class_get | ( | DeviceClass_t * | currentClass | ) |
get the current Lora Class
currentClass | DeviceClass_t NewClass |
uint32_t lmh_getDevAddr | ( | void | ) |
Returns the Device address set by the LoRaWan server after OTAA join success.
returns | Device Address |
uint16_t ChannelsMask[] |
uint16_t ChannelsDefaultMask[] |
uint16_t ChannelsMaskRemaining[] |
bool _otaa = false |
bool _dutyCycleEnabled = false |
|
static |
End-device identifier
|
static |
Application identifier
|
static |
Application key
|
static |
|
static |
Network session key
|
static |
Application session key
|
static |
End-device address
bool singleChannelGateway = false |
Flag if connection is to a single channel gateway
uint8_t singleChannelSelected = 0 |
Channel to be used to communicate with a single channel gateway
int8_t singleChannelDatarate = DR_3 |
Datarate to be used to communicate with a single channel gateway
|
static |
LoRaMAC events variable
|
static |
LoRaMAC callback variable
|
static |
LoRaMAC MIB-RequestConfirm variable
|
static |
|
static |
|
static |
LoRaWAN compliance tests data
|
static |
|
static |
|
static |
|
static |
|
static |