Fork of Semtech LoRaWAN stack

Fork of LoRaWAN-lib by canuck lehead

Files at this revision

API Documentation at this revision

Comitter:
ubhat
Date:
Tue Sep 13 05:39:43 2016 +0000
Branch:
v4.2.0
Parent:
14:60c5d589a070
Child:
16:1e01c8728daa
Commit message:
RXParamSetupReq frequency bug fix

Changed in this revision

LoRaMac.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/LoRaMac.cpp	Tue Sep 06 11:02:17 2016 +0000
+++ b/LoRaMac.cpp	Tue Sep 13 05:39:43 2016 +0000
@@ -15,7 +15,7 @@
 
 License: Revised BSD License, see LICENSE.TXT file include in the project
 
-Maintainer: Miguel Luis ( Semtech ), Gregory Cristian ( Semtech ) and Daniel Jäckle ( STACKFORCE )
+Maintainer: Miguel Luis ( Semtech ), Gregory Cristian ( Semtech ) and Daniel Jäckle ( STACKFORCE )
 */
 #include "board.h"
 
@@ -2539,10 +2539,28 @@
                     freq |= ( uint32_t )payload[macIndex++] << 16;
                     freq *= 100;
 
+                   
+#if ( defined( USE_BAND_915 ) || defined( USE_BAND_915_HYBRID ) )
+                    if( ( freq < 923.2e6 ) || ( freq > 927.5e6 ) )
+                    {
+                        status &= 0xFE; // Channel frequency KO
+                    }
+                    else
+                    {
+                        uint32_t freqTmp;
+                        freqTmp = (int)( freq - 923.3e6 )/600e3;
+                        if( ( freq - 923.3e6 ) - ( freqTmp * 600e3 ) > 0 )
+                        {
+                            status &= 0xFE; // Channel frequency KO
+                        }                           
+                    }
+#else
                     if( Radio.CheckRfFrequency( freq ) == false )
                     {
                         status &= 0xFE; // Channel frequency KO
                     }
+#endif                        
+                    
 
                     if( ValueInRange( datarate, LORAMAC_RX_MIN_DATARATE, LORAMAC_RX_MAX_DATARATE ) == false )
                     {