Here it is ...

Dependencies:   libxDot-mbed5 TSL2561

Fork of Dot-Examples by MultiTech

Revision:
33:79e4c812d91d
Parent:
32:cc05a2e80969
Child:
35:b51d482e9731
--- a/examples/src/dot_util.cpp~	Thu Jul 12 12:54:47 2018 -0400
+++ b/examples/src/dot_util.cpp~	Thu Jul 19 10:48:47 2018 -0400
@@ -290,16 +290,18 @@
     }
 }
 
-void join_network() {
+void join_network(Serial *pc) {
     int32_t j_attempts = 0;
     int32_t ret = mDot::MDOT_ERROR;
     
     // attempt to join the network
     while (ret != mDot::MDOT_OK) {
         logInfo("attempt %d to join network", ++j_attempts);
+	(*pc).printf("attempt %d to join network\r\n", ++j_attempts);
         ret = dot->joinNetwork();
         if (ret != mDot::MDOT_OK) {
             logError("failed to join network %d:%s", ret, mDot::getReturnCodeString(ret).c_str());
+	    (*pc).printf("failed to join network %d:%s\r\n", ret, mDot::getReturnCodeString(ret).c_str());
             // in some frequency bands we need to wait until another channel is available before transmitting again
             uint32_t delay_s = (dot->getNextTxMs() / 1000) + 1;
             if (delay_s < 5) {
@@ -311,6 +313,7 @@
             }
         }
     }
+    (*pc).printf("j_n(): network join SUCCESSFUL\r\n");
 }
 
 void sleep_wake_rtc_only(bool deepsleep) {
@@ -722,3 +725,6 @@
     }
 }
 
+uint8_t get_light_data() {
+  return (uint8_t)(rand() % 100);
+}