LoRaMAC  4.4.6
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 
51 #define CHANNEL_PLAN_GROUP_AS923_1 1
52 
57 #define CHANNEL_PLAN_GROUP_AS923_2 2
58 
63 #define CHANNEL_PLAN_GROUP_AS923_3 3
64 
69 #define CHANNEL_PLAN_GROUP_AS923_1_JP 4
70 
74 #define AS923_MAX_NB_CHANNELS 16
75 
79 #define AS923_NUMB_DEFAULT_CHANNELS 2
80 
84 #define AS923_NUMB_CHANNELS_CF_LIST 5
85 
89 #define AS923_TX_MIN_DATARATE DR_0
90 
94 #define AS923_TX_MAX_DATARATE DR_7
95 
99 #define AS923_RX_MIN_DATARATE DR_0
100 
104 #define AS923_RX_MAX_DATARATE DR_7
105 
109 #define AS923_DEFAULT_DATARATE DR_2
110 
115 #define AS923_DWELL_LIMIT_DATARATE DR_2
116 
120 #define AS923_MIN_RX1_DR_OFFSET 0
121 
125 #define AS923_MAX_RX1_DR_OFFSET 7
126 
130 #define AS923_MIN_TX_POWER TX_POWER_7
131 
135 #define AS923_MAX_TX_POWER TX_POWER_0
136 
140 #define AS923_DEFAULT_TX_POWER TX_POWER_0
141 
145 #define AS923_DEFAULT_UPLINK_DWELL_TIME 1
146 
150 #define AS923_DEFAULT_MAX_EIRP 16.0f
151 
155 #define AS923_DEFAULT_ANTENNA_GAIN 2.15f
156 
160 #define AS923_DUTY_CYCLE_ENABLED 0
161 
165 #define AS923_MAX_RX_WINDOW 3000
166 
167 #if ( AS923_DEFAULT_DATARATE > DR_5 )
168 #error "A default DR higher than DR_5 may lead to connectivity loss."
169 #endif
170 
174 #define AS923_RX_WND_2_FREQ 923200000
175 
179 #define AS923_RX_WND_2_DR DR_2
180 
181 /*
182  * CLASS B
183  */
187 #define AS923_BEACON_CHANNEL_FREQ 923400000
188 
192 #define AS923_PING_SLOT_CHANNEL_FREQ 923400000
193 
197 #define AS923_BEACON_SIZE 17
198 
202 #define AS923_RFU1_SIZE 2
203 
207 #define AS923_RFU2_SIZE 0
208 
212 #define AS923_BEACON_CHANNEL_DR DR_3
213 
217 #define AS923_BEACON_CHANNEL_BW 0
218 
222 #define AS923_PING_SLOT_CHANNEL_DR DR_3
223 
227 #define AS923_MAX_NB_BANDS 1
228 
233 #define AS923_BAND0 { 100, AS923_MAX_TX_POWER, 0, 0, 0, 0, 0 } // 1.0 %
234 
239 #define AS923_LC1 { 923200000, 0, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
240 
245 #define AS923_LC2 { 923400000, 0, { ( ( DR_5 << 4 ) | DR_0 ) }, 0 }
246 
250 #define AS923_JOIN_CHANNELS ( uint16_t )( LC( 1 ) | LC( 2 ) )
251 
255 #define AS923_RSSI_FREE_TH -80
256 
260 #define AS923_CARRIER_SENSE_TIME 5
261 
265 static const uint8_t DataratesAS923[] = { 12, 11, 10, 9, 8, 7, 7, 50 };
266 
270 static const uint32_t BandwidthsAS923[] = { 125000, 125000, 125000, 125000, 125000, 125000, 250000, 0 };
271 
276 static const uint8_t MaxPayloadOfDatarateDwell0AS923[] = { 59, 59, 123, 123, 250, 250, 250, 250 };
277 
282 static const uint8_t MaxPayloadOfDatarateDwell1AS923[] = { 0, 0, 19, 61, 133, 250, 250, 250 };
283 
288 static const uint8_t MaxPayloadOfDatarateDwell1DownAS923[] = { 0, 0, 11, 53, 126, 242, 242, 242 };
289 
293 static const int8_t EffectiveRx1DrOffsetAS923[] = { 0, 1, 2, 3, 4, 5, -1, -2 };
294 
303 
310 
317 
327 bool RegionAS923Verify( VerifyParams_t* verify, PhyAttribute_t phyAttribute );
328 
335 void RegionAS923ApplyCFList( ApplyCFListParams_t* applyCFList );
336 
344 bool RegionAS923ChanMaskSet( ChanMaskSetParams_t* chanMaskSet );
345 
359 void RegionAS923ComputeRxWindowParameters( int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams );
360 
370 bool RegionAS923RxConfig( RxConfigParams_t* rxConfig, int8_t* datarate );
371 
383 bool RegionAS923TxConfig( TxConfigParams_t* txConfig, int8_t* txPower, TimerTime_t* txTimeOnAir );
384 
392 uint8_t RegionAS923LinkAdrReq( LinkAdrReqParams_t* linkAdrReq, int8_t* drOut, int8_t* txPowOut, uint8_t* nbRepOut, uint8_t* nbBytesParsed );
393 
401 uint8_t RegionAS923RxParamSetupReq( RxParamSetupReqParams_t* rxParamSetupReq );
402 
410 int8_t RegionAS923NewChannelReq( NewChannelReqParams_t* newChannelReq );
411 
421 int8_t RegionAS923TxParamSetupReq( TxParamSetupReqParams_t* txParamSetupReq );
422 
430 int8_t RegionAS923DlChannelReq( DlChannelReqParams_t* dlChannelReq );
431 
439 int8_t RegionAS923AlternateDr( int8_t currentDr, AlternateDrType_t type );
440 
453 LoRaMacStatus_t RegionAS923NextChannel( NextChanParams_t* nextChanParams, uint8_t* channel, TimerTime_t* time, TimerTime_t* aggregatedTimeOff );
454 
463 
471 bool RegionAS923ChannelsRemove( ChannelRemoveParams_t* channelRemove );
472 
479 
491 uint8_t RegionAS923ApplyDrOffset( uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset );
492 
498  void RegionAS923RxBeaconSetup( RxBeaconSetup_t* rxBeaconSetup, uint8_t* outDr );
499 
502 #ifdef __cplusplus
503 }
504 #endif
505 
506 #endif // __REGION_AS923_H__
AlternateDrType_t
AlternateDrType_t
Definition: Region.h:747
Region.h
Region implementation.
RegionAS923RxParamSetupReq
uint8_t RegionAS923RxParamSetupReq(RxParamSetupReqParams_t *rxParamSetupReq)
The function processes a RX Parameter Setup Request.
GetPhyParams_t
Definition: Region.h:412
RegionAS923ChannelAdd
LoRaMacStatus_t RegionAS923ChannelAdd(ChannelAddParams_t *channelAdd)
Adds a channel.
LoRaMacStatus_t
LoRaMacStatus_t
Definition: LoRaMac.h:2227
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.
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:547
ContinuousWaveParams_t
Definition: Region.h:827
NextChanParams_t
Definition: Region.h:762
RxBeaconSetup_t
Definition: Region.h:858
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:698
TxParamSetupReqParams_t
Definition: Region.h:713
RegionAS923NextChannel
LoRaMacStatus_t RegionAS923NextChannel(NextChanParams_t *nextChanParams, uint8_t *channel, TimerTime_t *time, TimerTime_t *aggregatedTimeOff)
Searches and set the next random available channel.
RegionAS923ApplyDrOffset
uint8_t RegionAS923ApplyDrOffset(uint8_t downlinkDwellTime, int8_t dr, int8_t drOffset)
Computes new datarate according to the given offset.
RegionAS923NewChannelReq
int8_t RegionAS923NewChannelReq(NewChannelReqParams_t *newChannelReq)
The function processes a Channel Request.
PhyAttribute_t
PhyAttribute_t
Definition: Region.h:84
RegionAS923SetContinuousWave
void RegionAS923SetContinuousWave(ContinuousWaveParams_t *continuousWave)
Sets the radio into continuous wave mode.
ChannelAddParams_t
Definition: Region.h:801
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:562
ApplyCFListParams_t
Definition: Region.h:532
DlChannelReqParams_t
Definition: Region.h:732
TxConfigParams_t
Definition: Region.h:609
RegionAS923TxParamSetupReq
int8_t RegionAS923TxParamSetupReq(TxParamSetupReqParams_t *txParamSetupReq)
The function processes a TX ParamSetup Request.
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:476
SetBandTxDoneParams_t
Definition: Region.h:449
RegionAS923ComputeRxWindowParameters
void RegionAS923ComputeRxWindowParameters(int8_t datarate, uint8_t minRxSymbols, uint32_t rxError, RxConfigParams_t *rxConfigParams)
RxParamSetupReqParams_t
Definition: Region.h:679
VerifyParams_t
Definition: Region.h:495
PhyParam_t
Definition: Region.h:381
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:816