LoRaMAC  4.6.0
Documentation of the API
RegionAS923.h
Go to the documentation of this file.
1 
37 #ifndef __REGION_AS923_H__
38 #define __REGION_AS923_H__
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
45 #include "region/Region.h"
46 
47 
52 #define CHANNEL_PLAN_GROUP_AS923_1 1
53 
58 #define CHANNEL_PLAN_GROUP_AS923_2 2
59 
64 #define CHANNEL_PLAN_GROUP_AS923_3 3
65 
70 #define CHANNEL_PLAN_GROUP_AS923_1 1
71 
76 #define CHANNEL_PLAN_GROUP_AS923_2 2
77 
82 #define CHANNEL_PLAN_GROUP_AS923_3 3
83 
88 #define CHANNEL_PLAN_GROUP_AS923_1_JP 4
89 
93 #define AS923_MAX_NB_CHANNELS 16
94 
98 #define AS923_NUMB_DEFAULT_CHANNELS 2
99 
103 #define AS923_NUMB_CHANNELS_CF_LIST 5
104 
108 #define AS923_TX_MIN_DATARATE DR_0
109 
113 #define AS923_TX_MAX_DATARATE DR_7
114 
118 #define AS923_RX_MIN_DATARATE DR_0
119 
123 #define AS923_RX_MAX_DATARATE DR_7
124 
128 #define AS923_DEFAULT_DATARATE DR_2
129 
134 #define AS923_DWELL_LIMIT_DATARATE DR_2
135 
139 #define AS923_MIN_RX1_DR_OFFSET 0
140 
144 #define AS923_MAX_RX1_DR_OFFSET 7
145 
149 #define AS923_MIN_TX_POWER TX_POWER_7
150 
154 #define AS923_MAX_TX_POWER TX_POWER_0
155 
159 #define AS923_DEFAULT_TX_POWER TX_POWER_0
160 
164 #define AS923_DEFAULT_UPLINK_DWELL_TIME 1
165 
169 #define AS923_DEFAULT_MAX_EIRP 16.0f
170 
174 #define AS923_DEFAULT_ANTENNA_GAIN 2.15f
175 
179 #define AS923_DUTY_CYCLE_ENABLED 0
180 
184 #define AS923_MAX_RX_WINDOW 3000
185 
186 #if ( AS923_DEFAULT_DATARATE > DR_5 )
187 #error "A default DR higher than DR_5 may lead to connectivity loss."
188 #endif
189 
193 #define AS923_RX_WND_2_FREQ 923200000
194 
198 #define AS923_RX_WND_2_DR DR_2
199 
200 /*
201  * CLASS B
202  */
206 #define AS923_BEACON_CHANNEL_FREQ 923400000
207 
211 #define AS923_PING_SLOT_CHANNEL_FREQ 923400000
212 
216 #define AS923_BEACON_SIZE 17
217 
221 #define AS923_RFU1_SIZE 1
222 
226 #define AS923_RFU2_SIZE 0
227 
231 #define AS923_BEACON_CHANNEL_DR DR_3
232 
236 #define AS923_BEACON_CHANNEL_BW 0
237 
241 #define AS923_PING_SLOT_CHANNEL_DR DR_3
242 
246 #define AS923_MAX_NB_BANDS 1
247 
252 #define AS923_BAND0 { 100, AS923_MAX_TX_POWER, 0, 0, 0, 0, 0 } // 1.0 %
253 
258 #define AS923_LC1 { 923200000, 0, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
259 
264 #define AS923_LC2 { 923400000, 0, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
265 
269 #define AS923_JOIN_CHANNELS ( uint16_t )( LC( 1 ) | LC( 2 ) )
270 
274 #define AS923_RSSI_FREE_TH -80
275 
279 #define AS923_CARRIER_SENSE_TIME 5
280 
284 static const uint8_t DataratesAS923[] = { 12, 11, 10, 9, 8, 7, 7, 50 };
285 
289 static const uint32_t BandwidthsAS923[] = { 125000, 125000, 125000, 125000, 125000, 125000, 250000, 0 };
290 
295 static const uint8_t MaxPayloadOfDatarateDwell0AS923[] = { 51, 51, 115, 115, 242, 242, 242, 242 };
296 
301 static const uint8_t MaxPayloadOfDatarateDwell1AS923[] = { 0, 0, 11, 53, 125, 242, 242, 242 };
302 
306 static const int8_t EffectiveRx1DrOffsetDownlinkDwell0AS923[8][8] =
307  {
308  { DR_0 , DR_0 , DR_0 , DR_0 , DR_0 , DR_0 , DR_1 , DR_2 }, // DR_0
309  { DR_1 , DR_0 , DR_0 , DR_0 , DR_0 , DR_0 , DR_2 , DR_3 }, // DR_1
310  { DR_2 , DR_1 , DR_0 , DR_0 , DR_0 , DR_0 , DR_3 , DR_4 }, // DR_2
311  { DR_3 , DR_2 , DR_1 , DR_0 , DR_0 , DR_0 , DR_4 , DR_5 }, // DR_3
312  { DR_4 , DR_3 , DR_2 , DR_1 , DR_0 , DR_0 , DR_5 , DR_6 }, // DR_4
313  { DR_5 , DR_4 , DR_3 , DR_2 , DR_1 , DR_0 , DR_6 , DR_7 }, // DR_5
314  { DR_6 , DR_5 , DR_4 , DR_3 , DR_2 , DR_1 , DR_7 , DR_7 }, // DR_6
315  { DR_7 , DR_6 , DR_5 , DR_4 , DR_3 , DR_2 , DR_7 , DR_7 }, // DR_7
316  };
317 
321 static const int8_t EffectiveRx1DrOffsetDownlinkDwell1AS923[8][8] =
322  {
323  { DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_2 }, // DR_0
324  { DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_3 }, // DR_1
325  { DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_3 , DR_4 }, // DR_2
326  { DR_3 , DR_2 , DR_2 , DR_2 , DR_2 , DR_2 , DR_4 , DR_5 }, // DR_3
327  { DR_4 , DR_3 , DR_2 , DR_2 , DR_2 , DR_2 , DR_5 , DR_6 }, // DR_4
328  { DR_5 , DR_4 , DR_3 , DR_2 , DR_2 , DR_2 , DR_6 , DR_7 }, // DR_5
329  { DR_6 , DR_5 , DR_4 , DR_3 , DR_2 , DR_2 , DR_7 , DR_7 }, // DR_6
330  { DR_7 , DR_6 , DR_5 , DR_4 , DR_3 , DR_2 , DR_7 , DR_7 }, // DR_7
331  };
332 
341 
348 
355 
365 bool RegionAS923Verify( VerifyParams_t* verify, PhyAttribute_t phyAttribute );
366 
373 void RegionAS923ApplyCFList( ApplyCFListParams_t* applyCFList );
374 
382 bool RegionAS923ChanMaskSet( ChanMaskSetParams_t* chanMaskSet );
383 
397 void RegionAS923ComputeRxWindowParameters( int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams );
398 
408 bool RegionAS923RxConfig( RxConfigParams_t* rxConfig, int8_t* datarate );
409 
421 bool RegionAS923TxConfig( TxConfigParams_t* txConfig, int8_t* txPower, TimerTime_t* txTimeOnAir );
422 
430 uint8_t RegionAS923LinkAdrReq( LinkAdrReqParams_t* linkAdrReq, int8_t* drOut, int8_t* txPowOut, uint8_t* nbRepOut, uint8_t* nbBytesParsed );
431 
439 uint8_t RegionAS923RxParamSetupReq( RxParamSetupReqParams_t* rxParamSetupReq );
440 
448 int8_t RegionAS923NewChannelReq( NewChannelReqParams_t* newChannelReq );
449 
459 int8_t RegionAS923TxParamSetupReq( TxParamSetupReqParams_t* txParamSetupReq );
460 
468 int8_t RegionAS923DlChannelReq( DlChannelReqParams_t* dlChannelReq );
469 
477 int8_t RegionAS923AlternateDr( int8_t currentDr, AlternateDrType_t type );
478 
491 LoRaMacStatus_t RegionAS923NextChannel( NextChanParams_t* nextChanParams, uint8_t* channel, TimerTime_t* time, TimerTime_t* aggregatedTimeOff );
492 
501 
509 bool RegionAS923ChannelsRemove( ChannelRemoveParams_t* channelRemove );
510 
522 uint8_t RegionAS923ApplyDrOffset( uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset );
523 
529  void RegionAS923RxBeaconSetup( RxBeaconSetup_t* rxBeaconSetup, uint8_t* outDr );
530 
533 #ifdef __cplusplus
534 }
535 #endif
536 
537 #endif // __REGION_AS923_H__
AlternateDrType_t
AlternateDrType_t
Definition: Region.h:756
Region.h
Region implementation.
RegionAS923RxParamSetupReq
uint8_t RegionAS923RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq)
The function processes a RX Parameter Setup Request.
GetPhyParams_t
Definition: Region.h:409
DR_6
#define DR_6
Definition: LoRaMacTypes.h:173
RegionAS923ChannelAdd
LoRaMacStatus_t RegionAS923ChannelAdd(ChannelAddParams_t *channelAdd)
Adds a channel.
LoRaMacStatus_t
LoRaMacStatus_t
Definition: LoRaMac.h:2345
DR_2
#define DR_2
Definition: LoRaMacTypes.h:109
RegionAS923InitDefaults
void RegionAS923InitDefaults(InitDefaultsParams_t *params)
Initializes the channels masks and the channels.
RegionAS923GetPhyParam
PhyParam_t RegionAS923GetPhyParam(GetPhyParams_t *getPhy)
The function gets a value of a specific phy attribute.
RegionAS923DlChannelReq
int8_t RegionAS923DlChannelReq(DlChannelReqParams_t *dlChannelReq)
The function processes a DlChannel Request.
DR_1
#define DR_1
Definition: LoRaMacTypes.h:93
RegionAS923ApplyCFList
void RegionAS923ApplyCFList(ApplyCFListParams_t *applyCFList)
The function parses the input buffer and sets up the channels of the CF list.
ChanMaskSetParams_t
Definition: Region.h:549
NextChanParams_t
Definition: Region.h:771
RxBeaconSetup_t
Definition: Region.h:836
RegionAS923SetBandTxDone
void RegionAS923SetBandTxDone(SetBandTxDoneParams_t *txDone)
Updates the last TX done parameters of the current channel.
RegionAS923RxBeaconSetup
void RegionAS923RxBeaconSetup(RxBeaconSetup_t *rxBeaconSetup, uint8_t *outDr)
Sets the radio into beacon reception mode.
RegionAS923Verify
bool RegionAS923Verify(VerifyParams_t *verify, PhyAttribute_t phyAttribute)
Verifies a parameter.
NewChannelReqParams_t
Definition: Region.h:707
TxParamSetupReqParams_t
Definition: Region.h:722
RegionAS923NextChannel
LoRaMacStatus_t RegionAS923NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
Searches and set the next random available channel.
DR_4
#define DR_4
Definition: LoRaMacTypes.h:141
RegionAS923ApplyDrOffset
uint8_t RegionAS923ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
Computes new datarate according to the given offset.
DR_5
#define DR_5
Definition: LoRaMacTypes.h:157
RegionAS923NewChannelReq
int8_t RegionAS923NewChannelReq(NewChannelReqParams_t *newChannelReq)
The function processes a Channel Request.
PhyAttribute_t
PhyAttribute_t
Definition: Region.h:85
DR_3
#define DR_3
Definition: LoRaMacTypes.h:125
ChannelAddParams_t
Definition: Region.h:810
RegionAS923AlternateDr
int8_t RegionAS923AlternateDr(int8_t currentDr, AlternateDrType_t type)
Alternates the datarate of the channel for the join request.
RxConfigParams_t
Definition: Region.h:564
DR_0
#define DR_0
Definition: LoRaMacTypes.h:77
ApplyCFListParams_t
Definition: Region.h:533
DlChannelReqParams_t
Definition: Region.h:741
TxConfigParams_t
Definition: Region.h:618
RegionAS923TxParamSetupReq
int8_t RegionAS923TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq)
The function processes a TX ParamSetup Request.
DR_7
#define DR_7
Definition: LoRaMacTypes.h:189
RegionAS923ChannelsRemove
bool RegionAS923ChannelsRemove(ChannelRemoveParams_t *channelRemove)
Removes a channel.
RegionAS923RxConfig
bool RegionAS923RxConfig(RxConfigParams_t *rxConfig, int8_t *datarate)
Configuration of the RX windows.
InitDefaultsParams_t
Definition: Region.h:473
SetBandTxDoneParams_t
Definition: Region.h:446
RegionAS923ComputeRxWindowParameters
void RegionAS923ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
RxParamSetupReqParams_t
Definition: Region.h:688
VerifyParams_t
Definition: Region.h:496
PhyParam_t
Definition: Region.h:378
RegionAS923ChanMaskSet
bool RegionAS923ChanMaskSet(ChanMaskSetParams_t *chanMaskSet)
Sets a channels mask.
RegionAS923TxConfig
bool RegionAS923TxConfig(TxConfigParams_t *txConfig, int8_t *txPower, TimerTime_t *txTimeOnAir)
TX configuration.
RegionAS923LinkAdrReq
uint8_t RegionAS923LinkAdrReq(LinkAdrReqParams_t *linkAdrReq, int8_t *drOut, int8_t *txPowOut, uint8_t *nbRepOut, uint8_t *nbBytesParsed)
The function processes a Link ADR Request.
ChannelRemoveParams_t
Definition: Region.h:825