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.
Dependencies: libmDot mbed mbed-rtos
Diff: main.cpp
- Revision:
- 11:1ecd1cdca9ef
- Parent:
- 10:79124c0a5952
- Child:
- 12:b31e43c9fb15
--- a/main.cpp	Sat Aug 13 10:27:50 2016 +0000
+++ b/main.cpp	Mon Aug 15 03:02:36 2016 +0000
@@ -150,6 +150,13 @@
             // send the data to the gateway
             if ((ret = dot->send(data)) != mDot::MDOT_OK) {
                logError("failed to send", ret, mDot::getReturnCodeString(ret).c_str());
+               // attempt to join the network
+               logInfo("rejoin network");
+               if ((ret = dot->joinNetworkOnce()) != mDot::MDOT_OK) {
+                  logError("failed to re-join network %d:%s", ret, mDot::getReturnCodeString(ret).c_str());
+                  // in the 868 (EU) frequency band, we need to wait until another channel is available before transmitting again
+                  //osDelay(std::max((uint32_t)2000, (uint32_t)dot->getNextTxMs()));
+               }           
             } else {
             logInfo("successfully sent data to gateway");
             }