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:
- 47:2bc515eeaa18
- Parent:
- 46:f5b9b5cedae6
--- a/examples/src/dot_util.cpp Mon Mar 01 02:47:26 2021 +0000
+++ b/examples/src/dot_util.cpp Sat May 15 02:59:15 2021 +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 = 10;
+ uint32_t delay_s = (dot->getNextTxMs() / 1000) + 1;
if (delay_s < 5) {
logInfo("waiting %lu s until next free channel", delay_s);
- ThisThread::sleep_for(delay_s);
+ wait(delay_s);
} else {
logInfo("sleeping %lu s until next free channel", delay_s);
dot->sleep(delay_s, mDot::RTC_ALARM, false);
@@ -721,4 +721,17 @@
return ret;
}
+/**
+int recv_data(std::vector<uint8_t> &data) {
+ uint32_t ret;
+
+ ret = dot->recv(data);
+ if (ret != mDot::MDOT_OK) {
+ logError("failed to receive data from %s [%d][%s]", dot->getJoinMode() == mDot::PEER_TO_PEER ? "peer" : "gateway", ret, mDot::getReturnCodeString(ret).c_str());
+ } else {
+ logInfo("successfully received data to %s", dot->getJoinMode() == mDot::PEER_TO_PEER ? "peer" : "gateway");
+ }
+ return ret;
+}
+**/
\ No newline at end of file