Fixed ADR issues with not applying new channel map
Dependents: eleven-x-semtech-workshop-demo
Fork of LoRaWAN-lib by
Diff: LoRaMac.cpp
- Revision:
- 10:1886ec2c5ca5
- Parent:
- 9:2d057079554c
diff -r 2d057079554c -r 1886ec2c5ca5 LoRaMac.cpp --- a/LoRaMac.cpp Tue Apr 25 18:04:46 2017 +0000 +++ b/LoRaMac.cpp Fri Apr 28 16:12:14 2017 +0000 @@ -22,7 +22,6 @@ #include "LoRaMacCrypto.h" #include "LoRaMac.h" #include "LoRaMacTest.h" -#include "SerialDisplay.h" /*! * Maximum PHY layer payload size @@ -1644,6 +1643,7 @@ default: break; } + if( datarate >= DR_4 ) {// LoRa 500 kHz bandwidth = 2; @@ -1852,17 +1852,7 @@ Channel = enabledChannels[randr( 0, nbEnabledChannels - 1 )]; #if defined( USE_BAND_915 ) || defined( USE_BAND_915_HYBRID ) if( Channel < ( LORA_MAX_NB_CHANNELS - 8 ) ) - { - //char maskStr[40]; - //ChannelsMaskRemaining - //sprintf(maskStr, "%d %04X %04X %04X %04X %04X %04X\n", Channels[Channel].Frequency, LoRaMacParams.ChannelsMask[0], LoRaMacParams.ChannelsMask[1], LoRaMacParams.ChannelsMask[2], LoRaMacParams.ChannelsMask[3], LoRaMacParams.ChannelsMask[4], LoRaMacParams.ChannelsMask[5]); - //sprintf(maskStr, "%d %04X %04X %04X %04X %04X %04X\n", Channels[Channel].Frequency, ChannelsMaskRemaining[0], ChannelsMaskRemaining[1], ChannelsMaskRemaining[2], ChannelsMaskRemaining[3], ChannelsMaskRemaining[4], ChannelsMaskRemaining[5]); - //SerialDisplayWrite(maskStr); - - //char maskStr[40]; - //sprintf(maskStr, "%d\n", Channels[Channel].Frequency); - //SerialDisplayWrite(maskStr); - + { DisableChannelInMask( Channel, ChannelsMaskRemaining ); } #endif @@ -2743,11 +2733,6 @@ if( dutyCycleTimeOff == 0 ) { // Try to send now - - //char maskStr[40]; - //sprintf(maskStr, "%d\n", Channels[Channel].Frequency); - //SerialDisplayWrite(maskStr); - return SendFrameOnChannel( Channels[Channel] ); } else