LoRaMAC  4.6.0
Documentation of the API
RegionUS915.h
Go to the documentation of this file.
1 
37 #ifndef __REGION_US915_H__
38 #define __REGION_US915_H__
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
45 #include "region/Region.h"
46 
50 #define US915_MAX_NB_CHANNELS 72
51 
55 #define US915_TX_MIN_DATARATE DR_0
56 
60 #define US915_TX_MAX_DATARATE DR_4
61 
65 #define US915_RX_MIN_DATARATE DR_8
66 
70 #define US915_RX_MAX_DATARATE DR_13
71 
75 #define US915_DEFAULT_DATARATE DR_0
76 
80 #define US915_MIN_RX1_DR_OFFSET 0
81 
85 #define US915_MAX_RX1_DR_OFFSET 3
86 
90 #define US915_MIN_TX_POWER TX_POWER_14
91 
95 #define US915_MAX_TX_POWER TX_POWER_0
96 
100 #define US915_DEFAULT_TX_POWER TX_POWER_0
101 
105 #define US915_DEFAULT_MAX_ERP 30.0f
106 
110 #define US915_DUTY_CYCLE_ENABLED 0
111 
115 #define US915_MAX_RX_WINDOW 3000
116 
120 #define US915_RX_WND_2_FREQ 923300000
121 
125 #define US915_RX_WND_2_DR DR_8
126 
130 #define US915_DEFAULT_UPLINK_DWELL_TIME 0
131 
132 /*
133  * CLASS B
134  */
138 #define US915_BEACON_CHANNEL_FREQ 923300000
139 
143 #define US915_BEACON_CHANNEL_STEPWIDTH 600000
144 
148 #define US915_PING_SLOT_CHANNEL_FREQ 923300000
149 
153 #define US915_BEACON_NB_CHANNELS 8
154 
158 #define US915_BEACON_SIZE 23
159 
163 #define US915_RFU1_SIZE 4
164 
168 #define US915_RFU2_SIZE 3
169 
173 #define US915_BEACON_CHANNEL_DR DR_8
174 
178 #define US915_BEACON_CHANNEL_BW 2
179 
183 #define US915_PING_SLOT_CHANNEL_DR DR_8
184 
188 #define US915_MAX_NB_BANDS 1
189 
194 #define US915_BAND0 { 1, US915_MAX_TX_POWER, 0, 0, 0, 0, 0 } // 100.0 %
195 
199 #define US915_FIRST_RX1_CHANNEL ( (uint32_t) 923300000 )
200 
204 #define US915_LAST_RX1_CHANNEL ( (uint32_t) 927500000 )
205 
209 #define US915_STEPWIDTH_RX1_CHANNEL ( (uint32_t) 600000 )
210 
214 static const uint8_t DataratesUS915[] = { 10, 9, 8, 7, 8, 0, 0, 0, 12, 11, 10, 9, 8, 7, 0, 0 };
215 
219 static const uint32_t BandwidthsUS915[] = { 125000, 125000, 125000, 125000, 500000, 0, 0, 0, 500000, 500000, 500000, 500000, 500000, 500000, 0, 0 };
220 
224 static const int8_t DatarateOffsetsUS915[5][4] =
225 {
226  { DR_10, DR_9 , DR_8 , DR_8 }, // DR_0
227  { DR_11, DR_10, DR_9 , DR_8 }, // DR_1
228  { DR_12, DR_11, DR_10, DR_9 }, // DR_2
229  { DR_13, DR_12, DR_11, DR_10 }, // DR_3
230  { DR_13, DR_13, DR_12, DR_11 }, // DR_4
231 };
232 
236 static const uint8_t MaxPayloadOfDatarateUS915[] = { 11, 53, 125, 242, 242, 0, 0, 0, 53, 129, 242, 242, 242, 242, 0, 0 };
237 
246 
253 
260 
270 bool RegionUS915Verify( VerifyParams_t* verify, PhyAttribute_t phyAttribute );
271 
278 void RegionUS915ApplyCFList( ApplyCFListParams_t* applyCFList );
279 
287 bool RegionUS915ChanMaskSet( ChanMaskSetParams_t* chanMaskSet );
288 
302 void RegionUS915ComputeRxWindowParameters( int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams );
303 
313 bool RegionUS915RxConfig( RxConfigParams_t* rxConfig, int8_t* datarate );
314 
326 bool RegionUS915TxConfig( TxConfigParams_t* txConfig, int8_t* txPower, TimerTime_t* txTimeOnAir );
327 
335 uint8_t RegionUS915LinkAdrReq( LinkAdrReqParams_t* linkAdrReq, int8_t* drOut, int8_t* txPowOut, uint8_t* nbRepOut, uint8_t* nbBytesParsed );
336 
344 uint8_t RegionUS915RxParamSetupReq( RxParamSetupReqParams_t* rxParamSetupReq );
345 
353 int8_t RegionUS915NewChannelReq( NewChannelReqParams_t* newChannelReq );
354 
364 int8_t RegionUS915TxParamSetupReq( TxParamSetupReqParams_t* txParamSetupReq );
365 
373 int8_t RegionUS915DlChannelReq( DlChannelReqParams_t* dlChannelReq );
374 
384 int8_t RegionUS915AlternateDr( int8_t currentDr, AlternateDrType_t type );
385 
398 LoRaMacStatus_t RegionUS915NextChannel( NextChanParams_t* nextChanParams, uint8_t* channel, TimerTime_t* time, TimerTime_t* aggregatedTimeOff );
399 
408 
416 bool RegionUS915ChannelsRemove( ChannelRemoveParams_t* channelRemove );
417 
429 uint8_t RegionUS915ApplyDrOffset( uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset );
430 
436 void RegionUS915RxBeaconSetup( RxBeaconSetup_t* rxBeaconSetup, uint8_t* outDr );
437 
440 #ifdef __cplusplus
441 }
442 #endif
443 
444 #endif // __REGION_US915_H__
RegionUS915RxParamSetupReq
uint8_t RegionUS915RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq)
The function processes a RX Parameter Setup Request.
RegionUS915RxBeaconSetup
void RegionUS915RxBeaconSetup(RxBeaconSetup_t *rxBeaconSetup, uint8_t *outDr)
Sets the radio into beacon reception mode.
AlternateDrType_t
AlternateDrType_t
Definition: Region.h:756
Region.h
Region implementation.
DR_8
#define DR_8
Definition: LoRaMacTypes.h:205
GetPhyParams_t
Definition: Region.h:409
RegionUS915InitDefaults
void RegionUS915InitDefaults(InitDefaultsParams_t *params)
Initializes the channels masks and the channels.
LoRaMacStatus_t
LoRaMacStatus_t
Definition: LoRaMac.h:2345
RegionUS915GetPhyParam
PhyParam_t RegionUS915GetPhyParam(GetPhyParams_t *getPhy)
The function gets a value of a specific phy attribute.
RegionUS915ApplyCFList
void RegionUS915ApplyCFList(ApplyCFListParams_t *applyCFList)
The function parses the input buffer and sets up the channels of the CF list.
RegionUS915ChannelAdd
LoRaMacStatus_t RegionUS915ChannelAdd(ChannelAddParams_t *channelAdd)
Adds a channel.
ChanMaskSetParams_t
Definition: Region.h:549
NextChanParams_t
Definition: Region.h:771
RxBeaconSetup_t
Definition: Region.h:836
DR_13
#define DR_13
Definition: LoRaMacTypes.h:285
RegionUS915ChanMaskSet
bool RegionUS915ChanMaskSet(ChanMaskSetParams_t *chanMaskSet)
Sets a channels mask.
NewChannelReqParams_t
Definition: Region.h:707
RegionUS915TxParamSetupReq
int8_t RegionUS915TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq)
The function processes a TX ParamSetup Request.
RegionUS915ChannelsRemove
bool RegionUS915ChannelsRemove(ChannelRemoveParams_t *channelRemove)
Removes a channel.
TxParamSetupReqParams_t
Definition: Region.h:722
DR_12
#define DR_12
Definition: LoRaMacTypes.h:269
RegionUS915NewChannelReq
int8_t RegionUS915NewChannelReq(NewChannelReqParams_t *newChannelReq)
The function processes a Channel Request.
RegionUS915ApplyDrOffset
uint8_t RegionUS915ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
Computes new datarate according to the given offset.
PhyAttribute_t
PhyAttribute_t
Definition: Region.h:85
RegionUS915LinkAdrReq
uint8_t RegionUS915LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed)
The function processes a Link ADR Request.
ChannelAddParams_t
Definition: Region.h:810
RegionUS915SetBandTxDone
void RegionUS915SetBandTxDone(SetBandTxDoneParams_t *txDone)
Updates the last TX done parameters of the current channel.
RxConfigParams_t
Definition: Region.h:564
ApplyCFListParams_t
Definition: Region.h:533
RegionUS915TxConfig
bool RegionUS915TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir)
TX configuration.
DlChannelReqParams_t
Definition: Region.h:741
TxConfigParams_t
Definition: Region.h:618
DR_9
#define DR_9
Definition: LoRaMacTypes.h:221
RegionUS915Verify
bool RegionUS915Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute)
Verifies a parameter.
RegionUS915NextChannel
LoRaMacStatus_t RegionUS915NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
Searches and set the next random available channel.
DR_10
#define DR_10
Definition: LoRaMacTypes.h:237
DR_11
#define DR_11
Definition: LoRaMacTypes.h:253
InitDefaultsParams_t
Definition: Region.h:473
RegionUS915DlChannelReq
int8_t RegionUS915DlChannelReq(DlChannelReqParams_t *dlChannelReq)
The function processes a DlChannel Request.
SetBandTxDoneParams_t
Definition: Region.h:446
RxParamSetupReqParams_t
Definition: Region.h:688
VerifyParams_t
Definition: Region.h:496
PhyParam_t
Definition: Region.h:378
RegionUS915ComputeRxWindowParameters
void RegionUS915ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
RegionUS915RxConfig
bool RegionUS915RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate)
Configuration of the RX windows.
RegionUS915AlternateDr
int8_t RegionUS915AlternateDr(int8_t currentDr, AlternateDrType_t type)
Alternates the datarate of the channel for the join request.
ChannelRemoveParams_t
Definition: Region.h:825