Fixed ADR issues with not applying new channel map
Dependents: eleven-x-semtech-workshop-demo
Fork of LoRaWAN-lib by
Diff: LoRaMac.cpp
- Revision:
- 9:2d057079554c
- Parent:
- 8:9a74243c53c0
- Child:
- 10:1886ec2c5ca5
--- a/LoRaMac.cpp Fri Apr 21 15:54:15 2017 +0000 +++ b/LoRaMac.cpp Tue Apr 25 18:04:46 2017 +0000 @@ -1858,6 +1858,10 @@ //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 ); } @@ -2739,6 +2743,11 @@ if( dutyCycleTimeOff == 0 ) { // Try to send now + + //char maskStr[40]; + //sprintf(maskStr, "%d\n", Channels[Channel].Frequency); + //SerialDisplayWrite(maskStr); + return SendFrameOnChannel( Channels[Channel] ); } else @@ -3219,11 +3228,11 @@ LoRaMacParamsDefaults.ChannelsMask[4] = 0x00FF; LoRaMacParamsDefaults.ChannelsMask[5] = 0x0000; #elif defined( USE_BAND_915_HYBRID ) - LoRaMacParamsDefaults.ChannelsMask[0] = 0x00FF; + LoRaMacParamsDefaults.ChannelsMask[0] = 0x01FE; LoRaMacParamsDefaults.ChannelsMask[1] = 0x0000; LoRaMacParamsDefaults.ChannelsMask[2] = 0x0000; LoRaMacParamsDefaults.ChannelsMask[3] = 0x0000; - LoRaMacParamsDefaults.ChannelsMask[4] = 0x0001; + LoRaMacParamsDefaults.ChannelsMask[4] = 0x0000; LoRaMacParamsDefaults.ChannelsMask[5] = 0x0000; #else #error "Please define a frequency band in the compiler options."