Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of LoRaWAN-lib by
Revision 8:8c9f22063c8d, committed 2017-11-01
- Comitter:
 - billvs
 - Date:
 - Wed Nov 01 20:44:06 2017 +0000
 - Parent:
 - 6:d7a34ded7c87
 - Commit message:
 - asif test
 
Changed in this revision
| LoRaMac.cpp | Show annotated file Show diff for this revision Revisions of this file | 
--- 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;
    