asif-test

Fork of LoRaWAN-lib by Semtech

Revision:
8:8c9f22063c8d
Parent:
6:d7a34ded7c87
--- a/LoRaMac.cpp	Wed May 18 11:19:24 2016 +0000
+++ b/LoRaMac.cpp	Wed Nov 01 20:44:06 2017 +0000
@@ -434,7 +434,9 @@
 /*!
  * Current channel index
  */
-static uint8_t Channel;
+uint8_t Channel;
+uint8_t Hard_channel = 8;
+int Force_channel;
 
 static uint8_t LastTxChannel;
 
@@ -1785,6 +1787,18 @@
         }
 #endif
         *time = 0;
+        if (Force_channel)
+        {
+           // Hard_channel = Hard_channel+1;
+            Hard_channel = 1;
+            if (Hard_channel > 32)
+            {
+                printf ("channel wrap\r\n");
+                Hard_channel = 8;
+            }
+            Channel = Hard_channel;
+            printf("Channel = changed to %d\r\n", Channel);
+        }
         return true;
     }
     else
@@ -2752,14 +2766,27 @@
     return LORAMAC_STATUS_OK;
 }
 
+int do_high_power;
+
+
 LoRaMacStatus_t SendFrameOnChannel( ChannelParams_t channel )
 {
     int8_t datarate = Datarates[ChannelsDatarate];
+    if (Force_channel)
+    {
+ //       printf("force DR\n");
+ //       datarate = DR_1;
+    }
     int8_t txPowerIndex = 0;
     int8_t txPower = 0;
 
     txPowerIndex = LimitTxPower( ChannelsTxPower );
     txPower = TxPowers[txPowerIndex];
+    if (do_high_power)
+    {
+        txPower = 30;
+        
+    }
 
     MlmeConfirm.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;
     McpsConfirm.Status = LORAMAC_EVENT_INFO_STATUS_ERROR;