Here it is ...

Dependencies:   libxDot-mbed5 TSL2561

Fork of Dot-Examples by MultiTech

Files at this revision

API Documentation at this revision

Comitter:
Mike Fiore
Date:
Fri Oct 07 15:48:23 2016 -0500
Parent:
8:e667f4a507b1
Child:
10:4d0b765f7b9e
Commit message:
save configuration after updating

Changed in this revision

examples/src/auto_ota_example.cpp Show annotated file Show diff for this revision Revisions of this file
examples/src/manual_example.cpp Show annotated file Show diff for this revision Revisions of this file
examples/src/ota_example.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/examples/src/auto_ota_example.cpp	Fri Oct 07 15:31:03 2016 -0500
+++ b/examples/src/auto_ota_example.cpp	Fri Oct 07 15:48:23 2016 -0500
@@ -57,10 +57,9 @@
     // 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_eui, network_key, frequency_sub_band, public_network, ack);
+    //update_ota_config_id_key(network_id, network_key, frequency_sub_band, public_network, ack);
     
     // save changes to configuration
-    // AUTO_OTA must be the saved join mode in order for the session to be properly restored after waking up from deepsleep
     logInfo("saving configuration");
     if (!dot->saveConfig()) {
         logError("failed to save configuration");
--- a/examples/src/manual_example.cpp	Fri Oct 07 15:31:03 2016 -0500
+++ b/examples/src/manual_example.cpp	Fri Oct 07 15:48:23 2016 -0500
@@ -61,6 +61,12 @@
     // 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);
 
+    // save changes to configuration
+    logInfo("saving configuration");
+    if (!dot->saveConfig()) {
+        logError("failed to save configuration");
+    }
+
     // restore the saved session if the dot woke from deepsleep mode
     // useful to use with deepsleep because session info is otherwise lost when the dot enters deepsleep
     if (dot->getStandbyFlag()) {
--- a/examples/src/ota_example.cpp	Fri Oct 07 15:31:03 2016 -0500
+++ b/examples/src/ota_example.cpp	Fri Oct 07 15:48:23 2016 -0500
@@ -57,6 +57,12 @@
     // 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);
+    
+    // save changes to configuration
+    logInfo("saving configuration");
+    if (!dot->saveConfig()) {
+        logError("failed to save configuration");
+    }
 
     // restore the saved session if the dot woke from deepsleep mode
     // useful to use with deepsleep because session info is otherwise lost when the dot enters deepsleep
@@ -64,7 +70,7 @@
         logInfo("restoring network session from NVM");
         dot->restoreNetworkSession();
     }
-    
+
     // display configuration
     display_config();