Modified version to include updated libmdot, mbedos, and code includes channel plan setting

Dependencies:   libmDot-mbed5

Fork of mDot_LoRa_Connect_Example_ABPA by MultiTech

Files at this revision

API Documentation at this revision

Comitter:
kellybs1
Date:
Sun Sep 10 05:30:38 2017 +0000
Parent:
13:b89684ebd04b
Commit message:
tidying up repos;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Aug 28 00:36:59 2017 +0000
+++ b/main.cpp	Sun Sep 10 05:30:38 2017 +0000
@@ -14,13 +14,18 @@
 net sess key: b35aca73d283996dc3cbc0803af04547
 app sess key: d6f28430da4035273b9e3c07eb30c0dd
 */
+//device address
 static uint8_t network_address[] = { 0x07, 0x23, 0x89, 0xf7 };
+//network session key
 static uint8_t network_session_key[] = { 0xb3, 0x5a, 0xca, 0x73, 0xd2, 0x83, 0x99, 0x6d, 0xc3, 0xcb, 0xc0, 0x80, 0x3a, 0xf0, 0x45, 0x47 };
+//application sesssion or data session key
 static uint8_t data_session_key[] = { 0xd6, 0xf2, 0x84, 0x30, 0xda, 0x40, 0x35, 0x27, 0x3b, 0x9e, 0x3c, 0x07, 0xeb, 0x30, 0xc0, 0xdd };
-static uint8_t frequency_sub_band = 2;
+static uint8_t frequency_sub_band = 2; //VFI
 static bool public_network = true;
+//enable receipt of ackknowledge packets 0 = No, 1 = Yes
 static uint8_t ack = 0;
-static bool adr = true;
+//adaptive data rate enabled
+static bool adr = false;
 
 Serial pc(USBTX, USBRX);
 
@@ -37,11 +42,7 @@
     // get a mDot handle
     dot = mDot::getInstance(plan);
     assert(dot);
-    
-    // enable or disable Adaptive Data Rate
-    dot->setAdr(adr);
-
-    
+      
     if (!dot->getStandbyFlag()) {
         logInfo("mbed-os library version: %d", MBED_LIBRARY_VERSION);
 
@@ -72,7 +73,19 @@
         //   * if you change the network address, network session key, or data session key, make sure you update them on the gateway
         // to provision your Dot with a 3rd party gateway, see the gateway or network provider documentation
         update_manual_config(network_address, network_session_key, data_session_key, frequency_sub_band, public_network, ack);
-
+     
+        // enable or disable Adaptive Data Rate
+        dot->setAdr(adr);
+        
+        //* AU915 Datarates
+        //* ---------------
+        //* DR0 - SF10BW125 -- 11 bytes
+        //* DR1 - SF9BW125 -- 53 bytes
+        //* DR2 - SF8BW125 -- 129 byte
+        //* DR3 - SF7BW125 -- 242 bytes
+        //* DR4 - SF8BW500 -- 242 bytes
+        dot->setTxDataRate(mDot::DR2);
+        
         
         // save changes to configuration
         logInfo("saving configuration");