Correction in RX config error. If REG_LR_PAYLOADLENGTH and REG_LR_PAYLOADMAXLENGTH is not set, the RX is limited to 64 bytes.

Fork of SX1276Lib by Semtech

Files at this revision

API Documentation at this revision

Comitter:
firis
Date:
Tue May 03 19:18:20 2016 +0000
Parent:
24:79c5b50b2b9c
Commit message:
Correction in RX config error. If REG_LR_PAYLOADLENGTH and REG_LR_PAYLOADMAXLENGTH is not set, the RX is limited to 64 bytes.

Changed in this revision

sx1276/sx1276.cpp Show annotated file Show diff for this revision Revisions of this file
sx1276/sx1276.h Show annotated file Show diff for this revision Revisions of this file
--- a/sx1276/sx1276.cpp	Tue Mar 15 13:12:44 2016 +0000
+++ b/sx1276/sx1276.cpp	Tue May 03 19:18:20 2016 +0000
@@ -330,9 +330,16 @@
             Write( REG_LR_PREAMBLEMSB, ( uint8_t )( ( preambleLen >> 8 ) & 0xFF ) );
             Write( REG_LR_PREAMBLELSB, ( uint8_t )( preambleLen & 0xFF ) );
 
-            if( fixLen == 1 )
+            //write PAYLOADLENGTH and PAYLOADMAXLENGTH even if it's not in fixedLength
+            if (payloadLen == 0)
             {
-                Write( REG_LR_PAYLOADLENGTH, payloadLen );
+                Write(REG_LR_PAYLOADLENGTH, RX_BUFFER_SIZE);
+                Write(REG_LR_PAYLOADMAXLENGTH, RX_BUFFER_SIZE);
+            }
+            else
+            {
+                Write(REG_LR_PAYLOADLENGTH, payloadLen);
+                Write(REG_LR_PAYLOADMAXLENGTH, payloadLen);
             }
 
             if( this->settings.LoRa.FreqHopOn == true )
--- a/sx1276/sx1276.h	Tue Mar 15 13:12:44 2016 +0000
+++ b/sx1276/sx1276.h	Tue May 03 19:18:20 2016 +0000
@@ -31,7 +31,7 @@
 #define XTAL_FREQ                                   32000000
 #define FREQ_STEP                                   61.03515625
 
-#define RX_BUFFER_SIZE                              256
+#define RX_BUFFER_SIZE                              0xff
 
 /*!
  * Constant values need to compute the RSSI value