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: Senet_Packet mDot_X_NUCLEO_IKS01A1 libmDot-dev-mbed5-deprecated
Fork of mDot-IKS01A1 by
Revision 8:bfbc3dd47166, committed 2016-12-16
- Comitter:
- pferland
- Date:
- Fri Dec 16 04:24:54 2016 +0000
- Parent:
- 7:d2052933ebcb
- Child:
- 9:e642e8f9ea37
- Commit message:
- Updated for Seattle demo
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Dec 15 23:50:05 2016 +0000
+++ b/main.cpp Fri Dec 16 04:24:54 2016 +0000
@@ -23,6 +23,7 @@
// True for Senet, false for your Conduit.
static bool public_network = true;
static uint8_t ack = 0;
+static uint8_t tx_datarate = mDot::DR3;
// deepsleep consumes slightly less current than sleep
// in sleep mode, IO state is maintained, RAM is retained, and application will resume after waking up
@@ -53,7 +54,8 @@
/* Initialize mDot */
dot = mDot::getInstance();
- dot->setAdr(true);
+
+ //dot->setAdr(true);
mts::MTSLog::setLogLevel(mts::MTSLog::INFO_LEVEL);
dot->setEvents(&events);
@@ -73,6 +75,14 @@
logError("failed to set network join mode to AUTO_OTA");
}
}
+
+ uint32_t current_tx_datarate = dot->getTxDataRate();
+ if (current_tx_datarate != tx_datarate) {
+ logInfo("changing TX datarate from %u to %u", current_tx_datarate, tx_datarate);
+ if (dot->setTxDataRate(tx_datarate) != mDot::MDOT_OK) {
+ logError("failed to set TX datarate to %u", tx_datarate);
+ }
+ }
// in OTA and AUTO_OTA join modes, the credentials can be passed to the library as a name and passphrase or an ID and KEY
// only one method or the other should be used!
// network ID = crc64(network name)
