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-mbed5 ISL29011
Diff: examples/src/dot_util.cpp
- Revision:
- 44:89b8ed62c32c
- Parent:
- 33:15ea8f985c54
- Child:
- 46:f5b9b5cedae6
--- a/examples/src/dot_util.cpp Tue Aug 25 02:48:32 2020 +0000 +++ b/examples/src/dot_util.cpp Wed Nov 11 00:27:58 2020 +0000 @@ -298,10 +298,10 @@ if (ret != mDot::MDOT_OK) { logError("failed to join network %d:%s", 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; + uint32_t delay_s = 8; if (delay_s < 5) { logInfo("waiting %lu s until next free channel", delay_s); - wait(delay_s); + ThisThread::sleep_for(delay_s); } else { logInfo("sleeping %lu s until next free channel", delay_s); dot->sleep(delay_s, mDot::RTC_ALARM, false); @@ -368,10 +368,10 @@ } else { // configure XBEE_DIO7 pin as the pin that will wake the mDot from low power modes // other pins can be confgured instead: XBEE_DIO2-6, XBEE_DI8, XBEE_DIN - dot->setWakePin(XBEE_DIO7); + dot->setWakePin(PA_11); } - logInfo("%ssleeping until interrupt on %s pin", deepsleep ? "deep" : "", deepsleep ? "DIO7" : mDot::pinName2Str(dot->getWakePin()).c_str()); + logInfo("%ssleeping mDot until interrupt on %s pin", deepsleep ? "deep" : "", deepsleep ? "DIO7" : mDot::pinName2Str(dot->getWakePin()).c_str()); #endif logInfo("application will %s after waking up", deepsleep ? "execute from beginning" : "resume"); @@ -408,6 +408,7 @@ // in some frequency bands we need to wait until another channel is available before transmitting again // wait at least 10s between transmissions uint32_t delay_s = dot->getNextTxMs() / 1000; + //uint32_t delay_s = 1000; if (delay_s < 10) { delay_s = 10; } @@ -715,7 +716,7 @@ if (ret != mDot::MDOT_OK) { logError("failed to send data to %s [%d][%s]", dot->getJoinMode() == mDot::PEER_TO_PEER ? "peer" : "gateway", ret, mDot::getReturnCodeString(ret).c_str()); } else { - logInfo("successfully sent data to %s", dot->getJoinMode() == mDot::PEER_TO_PEER ? "peer" : "gateway"); + logInfo("Successfully sent data to Cloudtracker"); } return ret;