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-Custom MTS-Serial
Fork of mDot_AT_firmware_CUSTOM by
To change channel plans replace AS923 with AU915, EU868, KR920 or US915 on line 15
#define CHANNEL_PLAN CP_AS923
Diff: main.cpp
- Revision:
- 9:ff62b20f7000
- Parent:
- 4:666017851052
- Child:
- 12:98445fa50cd3
diff -r a8be708e0e56 -r ff62b20f7000 main.cpp --- a/main.cpp Mon Apr 04 13:17:44 2016 +0000 +++ b/main.cpp Mon Apr 04 09:00:31 2016 -0500 @@ -1,21 +1,33 @@ -#include "mbed.h" -#include "mDot.h" -#include "CommandTerminal.h" - -Serial debug(USBTX, USBRX); - -mts::MTSSerial serial(XBEE_DOUT, XBEE_DIN, 512, 512); - -int main() -{ - debug.baud(115200); - - mDot* dot = mDot::getInstance(); - - debug.baud(dot->getDebugBaud()); - serial.baud(dot->getBaud()); - - CommandTerminal term(serial, dot); - - term.start(); -} +#include "mbed.h" +#include "mDot.h" +#include "CommandTerminal.h" +#include "ATSerial.h" +#include "ATSerialFlowControl.h" + +#define SERIAL_BUFFER_SIZE 512 + +mts::ATSerial debug(USBTX, USBRX); + +int main() +{ + debug.baud(115200); + + mDot* dot = mDot::getInstance(); + + // Seed the RNG + srand(dot->getRadioRandom()); + + mts::ATSerial* serial; + + if (dot->getFlowControl()) + serial = new mts::ATSerialFlowControl(XBEE_DOUT, XBEE_DIN, XBEE_RTS, XBEE_CTS, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); + else + serial = new mts::ATSerial(XBEE_DOUT, XBEE_DIN, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); + + debug.baud(dot->getDebugBaud()); + serial->baud(dot->getBaud()); + + CommandTerminal term(*serial, dot); + + term.start(); +}