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
main.cpp@9:ff62b20f7000, 2016-04-04 (annotated)
- Committer:
- Mike Fiore
- Date:
- Mon Apr 04 09:00:31 2016 -0500
- Revision:
- 9:ff62b20f7000
- Parent:
- 4:666017851052
- Child:
- 12:98445fa50cd3
update to version 1.0.8 of AT firmware
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Mike Fiore |
9:ff62b20f7000 | 1 | #include "mbed.h" |
Mike Fiore |
9:ff62b20f7000 | 2 | #include "mDot.h" |
Mike Fiore |
9:ff62b20f7000 | 3 | #include "CommandTerminal.h" |
Mike Fiore |
9:ff62b20f7000 | 4 | #include "ATSerial.h" |
Mike Fiore |
9:ff62b20f7000 | 5 | #include "ATSerialFlowControl.h" |
Mike Fiore |
9:ff62b20f7000 | 6 | |
Mike Fiore |
9:ff62b20f7000 | 7 | #define SERIAL_BUFFER_SIZE 512 |
Mike Fiore |
9:ff62b20f7000 | 8 | |
Mike Fiore |
9:ff62b20f7000 | 9 | mts::ATSerial debug(USBTX, USBRX); |
Mike Fiore |
9:ff62b20f7000 | 10 | |
Mike Fiore |
9:ff62b20f7000 | 11 | int main() |
Mike Fiore |
9:ff62b20f7000 | 12 | { |
Mike Fiore |
9:ff62b20f7000 | 13 | debug.baud(115200); |
Mike Fiore |
9:ff62b20f7000 | 14 | |
Mike Fiore |
9:ff62b20f7000 | 15 | mDot* dot = mDot::getInstance(); |
Mike Fiore |
9:ff62b20f7000 | 16 | |
Mike Fiore |
9:ff62b20f7000 | 17 | // Seed the RNG |
Mike Fiore |
9:ff62b20f7000 | 18 | srand(dot->getRadioRandom()); |
Mike Fiore |
9:ff62b20f7000 | 19 | |
Mike Fiore |
9:ff62b20f7000 | 20 | mts::ATSerial* serial; |
Mike Fiore |
9:ff62b20f7000 | 21 | |
Mike Fiore |
9:ff62b20f7000 | 22 | if (dot->getFlowControl()) |
Mike Fiore |
9:ff62b20f7000 | 23 | serial = new mts::ATSerialFlowControl(XBEE_DOUT, XBEE_DIN, XBEE_RTS, XBEE_CTS, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); |
Mike Fiore |
9:ff62b20f7000 | 24 | else |
Mike Fiore |
9:ff62b20f7000 | 25 | serial = new mts::ATSerial(XBEE_DOUT, XBEE_DIN, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); |
Mike Fiore |
9:ff62b20f7000 | 26 | |
Mike Fiore |
9:ff62b20f7000 | 27 | debug.baud(dot->getDebugBaud()); |
Mike Fiore |
9:ff62b20f7000 | 28 | serial->baud(dot->getBaud()); |
Mike Fiore |
9:ff62b20f7000 | 29 | |
Mike Fiore |
9:ff62b20f7000 | 30 | CommandTerminal term(*serial, dot); |
Mike Fiore |
9:ff62b20f7000 | 31 | |
Mike Fiore |
9:ff62b20f7000 | 32 | term.start(); |
Mike Fiore |
9:ff62b20f7000 | 33 | } |