LoRaMAC  4.4.5
Documentation of the API
Region.h File Reference

Region implementation. More...

#include <stdint.h>
#include <stdbool.h>
#include "utilities.h"
#include "LoRaMac.h"
#include "timer.h"
#include "RegionCommon.h"

Go to the source code of this file.

Data Structures

struct  BeaconFormat_t
 
union  PhyParam_t
 
struct  GetPhyParams_t
 
struct  SetBandTxDoneParams_t
 
struct  InitDefaultsParams_t
 
struct  GetNvmCtxParams_t
 
union  VerifyParams_t
 
struct  VerifyParams_t::sDatarateParams
 
struct  ApplyCFListParams_t
 
struct  ChanMaskSetParams_t
 
struct  RxConfigParams_t
 
struct  TxConfigParams_t
 
struct  RxParamSetupReqParams_t
 
struct  NewChannelReqParams_t
 
struct  TxParamSetupReqParams_t
 
struct  DlChannelReqParams_t
 
struct  NextChanParams_t
 
struct  ChannelAddParams_t
 
struct  ChannelRemoveParams_t
 
struct  ContinuousWaveParams_t
 
struct  RxBeaconSetup_t
 

Macros

#define LC(channelIndex)   ( uint16_t )( 1 << ( channelIndex - 1 ) )
 
#define REGION_VERSION   0x00010003
 
#define DR_0   0
 
#define DR_1   1
 
#define DR_2   2
 
#define DR_3   3
 
#define DR_4   4
 
#define DR_5   5
 
#define DR_6   6
 
#define DR_7   7
 
#define DR_8   8
 
#define DR_9   9
 
#define DR_10   10
 
#define DR_11   11
 
#define DR_12   12
 
#define DR_13   13
 
#define DR_14   14
 
#define DR_15   15
 
#define TX_POWER_0   0
 
#define TX_POWER_1   1
 
#define TX_POWER_2   2
 
#define TX_POWER_3   3
 
#define TX_POWER_4   4
 
#define TX_POWER_5   5
 
#define TX_POWER_6   6
 
#define TX_POWER_7   7
 
#define TX_POWER_8   8
 
#define TX_POWER_9   9
 
#define TX_POWER_10   10
 
#define TX_POWER_11   11
 
#define TX_POWER_12   12
 
#define TX_POWER_13   13
 
#define TX_POWER_14   14
 
#define TX_POWER_15   15
 

Enumerations

enum  PhyAttribute_t {
  PHY_FREQUENCY, PHY_MIN_RX_DR, PHY_MIN_TX_DR, PHY_MAX_RX_DR,
  PHY_MAX_TX_DR, PHY_TX_DR, PHY_DEF_TX_DR, PHY_RX_DR,
  PHY_MAX_TX_POWER, PHY_TX_POWER, PHY_DEF_TX_POWER, PHY_DEF_ADR_ACK_LIMIT,
  PHY_DEF_ADR_ACK_DELAY, PHY_MAX_PAYLOAD, PHY_DUTY_CYCLE, PHY_MAX_RX_WINDOW,
  PHY_RECEIVE_DELAY1, PHY_RECEIVE_DELAY2, PHY_JOIN_ACCEPT_DELAY1, PHY_JOIN_ACCEPT_DELAY2,
  PHY_MAX_FCNT_GAP, PHY_ACK_TIMEOUT, PHY_DEF_DR1_OFFSET, PHY_DEF_RX2_FREQUENCY,
  PHY_DEF_RX2_DR, PHY_CHANNELS_MASK, PHY_CHANNELS_DEFAULT_MASK, PHY_MAX_NB_CHANNELS,
  PHY_CHANNELS, PHY_DEF_UPLINK_DWELL_TIME, PHY_DEF_DOWNLINK_DWELL_TIME, PHY_DEF_MAX_EIRP,
  PHY_DEF_ANTENNA_GAIN, PHY_NEXT_LOWER_TX_DR, PHY_BEACON_INTERVAL, PHY_BEACON_RESERVED,
  PHY_BEACON_GUARD, PHY_BEACON_WINDOW, PHY_BEACON_WINDOW_SLOTS, PHY_PING_SLOT_WINDOW,
  PHY_BEACON_SYMBOL_TO_DEFAULT, PHY_BEACON_SYMBOL_TO_EXPANSION_MAX, PHY_PING_SLOT_SYMBOL_TO_EXPANSION_MAX, PHY_BEACON_SYMBOL_TO_EXPANSION_FACTOR,
  PHY_PING_SLOT_SYMBOL_TO_EXPANSION_FACTOR, PHY_MAX_BEACON_LESS_PERIOD, PHY_BEACON_DELAY_BEACON_TIMING_ANS, PHY_BEACON_CHANNEL_FREQ,
  PHY_BEACON_FORMAT, PHY_BEACON_CHANNEL_DR, PHY_BEACON_NB_CHANNELS, PHY_BEACON_CHANNEL_OFFSET,
  PHY_PING_SLOT_CHANNEL_FREQ, PHY_PING_SLOT_CHANNEL_DR, PHY_PING_SLOT_NB_CHANNELS, PHY_SF_FROM_DR,
  PHY_BW_FROM_DR
}
 
enum  InitType_t { INIT_TYPE_DEFAULTS, INIT_TYPE_RESET_TO_DEFAULT_CHANNELS, INIT_TYPE_ACTIVATE_DEFAULT_CHANNELS, INIT_TYPE_RESTORE_CTX }
 
enum  ChannelsMask_t { CHANNELS_MASK, CHANNELS_DEFAULT_MASK }
 
enum  AlternateDrType_t { ALTERNATE_DR, ALTERNATE_DR_RESTORE }
 

Functions

bool RegionIsActive (LoRaMacRegion_t region)
 The function verifies if a region is active or not. If a region is not active, it cannot be used. More...
 
PhyParam_t RegionGetPhyParam (LoRaMacRegion_t region, GetPhyParams_t *getPhy)
 The function gets a value of a specific phy attribute. More...
 
void RegionSetBandTxDone (LoRaMacRegion_t region, SetBandTxDoneParams_t *txDone)
 Updates the last TX done parameters of the current channel. More...
 
void RegionInitDefaults (LoRaMacRegion_t region, InitDefaultsParams_t *params)
 Initializes the channels masks and the channels. More...
 
void * RegionGetNvmCtx (LoRaMacRegion_t region, GetNvmCtxParams_t *params)
 Returns a pointer to the internal context and its size. More...
 
bool RegionVerify (LoRaMacRegion_t region, VerifyParams_t *verify, PhyAttribute_t phyAttribute)
 Verifies a parameter. More...
 
void RegionApplyCFList (LoRaMacRegion_t region, ApplyCFListParams_t *applyCFList)
 The function parses the input buffer and sets up the channels of the CF list. More...
 
bool RegionChanMaskSet (LoRaMacRegion_t region, ChanMaskSetParams_t *chanMaskSet)
 Sets a channels mask. More...
 
bool RegionRxConfig (LoRaMacRegion_t region, RxConfigParams_t *rxConfig, int8_t *datarate)
 Configuration of the RX windows. More...
 
void RegionComputeRxWindowParameters (LoRaMacRegion_t region, int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
 
bool RegionTxConfig (LoRaMacRegion_t region, TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir)
 TX configuration. More...
 
uint8_t RegionLinkAdrReq (LoRaMacRegion_t region, LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed)
 The function processes a Link ADR Request. More...
 
uint8_t RegionRxParamSetupReq (LoRaMacRegion_t region, RxParamSetupReqParams_t *rxParamSetupReq)
 The function processes a RX Parameter Setup Request. More...
 
uint8_t RegionNewChannelReq (LoRaMacRegion_t region, NewChannelReqParams_t *newChannelReq)
 The function processes a New Channel Request. More...
 
int8_t RegionTxParamSetupReq (LoRaMacRegion_t region, TxParamSetupReqParams_t *txParamSetupReq)
 The function processes a TX ParamSetup Request. More...
 
uint8_t RegionDlChannelReq (LoRaMacRegion_t region, DlChannelReqParams_t *dlChannelReq)
 The function processes a DlChannel Request. More...
 
int8_t RegionAlternateDr (LoRaMacRegion_t region, int8_t currentDr, AlternateDrType_t type)
 Alternates the datarate of the channel for the join request. More...
 
LoRaMacStatus_t RegionNextChannel (LoRaMacRegion_t region, NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
 Searches and set the next random available channel. More...
 
LoRaMacStatus_t RegionChannelAdd (LoRaMacRegion_t region, ChannelAddParams_t *channelAdd)
 Adds a channel. More...
 
bool RegionChannelsRemove (LoRaMacRegion_t region, ChannelRemoveParams_t *channelRemove)
 Removes a channel. More...
 
void RegionSetContinuousWave (LoRaMacRegion_t region, ContinuousWaveParams_t *continuousWave)
 Sets the radio into continuous wave mode. More...
 
uint8_t RegionApplyDrOffset (LoRaMacRegion_t region, uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
 Computes new datarate according to the given offset. More...
 
void RegionRxBeaconSetup (LoRaMacRegion_t region, RxBeaconSetup_t *rxBeaconSetup, uint8_t *outDr)
 Sets the radio into beacon reception mode. More...
 
Version_t RegionGetVersion (void)
 Gets the version of the regional parameters implementation. More...
 

Detailed Description

Region implementation.

______ _
/ _____) _ | |
( (____ _____ ____ _| |_ _____ ____| |__
\____ \| ___ | (_ _) ___ |/ ___) _ \
_____) ) ____| | | || |_| ____( (___| | | |
(______/|_____)_|_|_| \__)_____)\____)_| |_|
(C)2013-2017 Semtech
___ _____ _ ___ _ _____ ___ ___ ___ ___
/ __|_ _/_\ / __| |/ / __/ _ \| _ \/ __| __|
\__ \ | |/ _ \ (__| ' <| _| (_) | / (__| _|
|___/ |_/_/ \_\___|_|\_\_| \___/|_|_\\___|___|
embedded.connectivity.solutions===============
Author
Miguel Luis ( Semtech )
Gregory Cristian ( Semtech )
Daniel Jaeckle ( STACKFORCE )

Data Structure Documentation

◆ VerifyParams_t::sDatarateParams

struct VerifyParams_t::sDatarateParams

Datarate to verify.

Data Fields
int8_t Datarate

Datarate to verify.

uint8_t DownlinkDwellTime

The downlink dwell time.

uint8_t UplinkDwellTime

The up link dwell time.