Here it is ...

Dependencies:   libxDot-mbed5 TSL2561

Fork of Dot-Examples by MultiTech

Files at this revision

API Documentation at this revision

Comitter:
dgutsch
Date:
Wed Jun 06 20:04:20 2018 +0000
Parent:
29:8c26b1cb1ceb
Child:
31:b990f61b9ee0
Commit message:
configured for gateway

Changed in this revision

examples/src/ota_example.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/examples/src/ota_example.cpp	Tue May 22 20:01:38 2018 +0000
+++ b/examples/src/ota_example.cpp	Wed Jun 06 20:04:20 2018 +0000
@@ -22,12 +22,12 @@
 // * either the network name and passphrase can be used or //
 //     the network ID (8 bytes) and KEY (16 bytes)         //
 /////////////////////////////////////////////////////////////
-static std::string network_name = "MultiTech";
-static std::string network_passphrase = "MultiTech";
+static std::string network_name = "MTCDT-19400691";
+static std::string network_passphrase = "MTCDT-19400691";
 static uint8_t network_id[] = { 0x6C, 0x4E, 0xEF, 0x66, 0xF4, 0x79, 0x86, 0xA6 };
 static uint8_t network_key[] = { 0x1F, 0x33, 0xA1, 0x70, 0xA5, 0xF1, 0xFD, 0xA0, 0xAB, 0x69, 0x7A, 0xAE, 0x2B, 0x95, 0x91, 0x6B };
-static uint8_t frequency_sub_band = 0;
-static lora::NetworkType public_network;//  = lora::PUBLIC_LORAWAN;
+static uint8_t frequency_sub_band = 1;
+static lora::NetworkType public_network;// = lora::PUBLIC_LORAWAN;
 static uint8_t join_delay = 5;
 static uint8_t ack = 0;
 static bool adr = true;
@@ -44,10 +44,12 @@
 Serial pc(USBTX, USBRX);
 
 int main() {
+    pc.printf("main started \r\n");
     // Custom event handler for automatically displaying RX data
     RadioEvent events;
 
     pc.baud(115200);
+    pc.printf("baud rate set \r\n");
 
     mts::MTSLog::setLogLevel(mts::MTSLog::TRACE_LEVEL);
     
@@ -96,8 +98,8 @@
         // only one method or the other should be used!
         // network ID = crc64(network name)
         // network KEY = cmac(network passphrase)
-        update_ota_config_name_phrase(network_name, network_passphrase, frequency_sub_band, public_network, ack);
-        //update_ota_config_id_key(network_id, network_key, frequency_sub_band, public_network, ack);
+        //update_ota_config_name_phrase(network_name, network_passphrase, frequency_sub_band, public_network, ack);// use the line below
+        update_ota_config_id_key(network_id, network_key, frequency_sub_band, public_network, ack); ///
 
         // configure network link checks
         // network link checks are a good alternative to requiring the gateway to ACK every packet and should allow a single gateway to handle more Dots