Driver for the SX1272 RF Transceiver

Fork of SX1272Lib by Semtech

Files at this revision

API Documentation at this revision

Comitter:
mluis
Date:
Tue Apr 04 11:41:39 2017 +0000
Parent:
11:cfa462865c9b
Commit message:
Synchronized with https://github.com/Lora-net/LoRaMac-node git commit 8050de6f98b4634672d989a27dc2d163fae985dd

Changed in this revision

enums/enums.h Show annotated file Show diff for this revision Revisions of this file
sx1272/sx1272.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/enums/enums.h	Fri Mar 17 16:53:05 2017 +0000
+++ b/enums/enums.h	Tue Apr 04 11:41:39 2017 +0000
@@ -102,6 +102,7 @@
     bool     IqInverted;
     bool     RxContinuous;
     uint32_t TxTimeout;
+    bool     PublicNetwork;
 }RadioLoRaSettings_t;
 
 /*!
--- a/sx1272/sx1272.cpp	Fri Mar 17 16:53:05 2017 +0000
+++ b/sx1272/sx1272.cpp	Tue Apr 04 11:41:39 2017 +0000
@@ -912,6 +912,7 @@
 void SX1272::SetPublicNetwork( bool enable )
 {
     SetModem( MODEM_LORA );
+    this->settings.LoRa.PublicNetwork = enable;
     if( enable == true )
     {
         // Change LoRa modem SyncWord
@@ -961,21 +962,26 @@
         }
         break;
     case RF_TX_RUNNING:
-        // Tx timeout shouldn't happen. 
+        // Tx timeout shouldn't happen.
         // But it has been observed that when it happens it is a result of a corrupted SPI transfer
         // it depends on the platform design.
         // 
         // The workaround is to put the radio in a known state. Thus, we re-initialize it.
-        //
+
         // BEGIN WORKAROUND
+
+        // Reset the radio
         Reset( );
 
+        // Initialize radio default values
         SetOpMode( RF_OPMODE_SLEEP );
 
         RadioRegistersInit( );
 
         SetModem( MODEM_FSK );
 
+        // Restore previous network type setting.
+        SetPublicNetwork( this->settings.LoRa.PublicNetwork );
         // END WORKAROUND
 
         this->settings.State = RF_IDLE;