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
- Committer:
- jreiss
- Date:
- 2017-01-06
- Revision:
- 24:739e3a700d34
- Parent:
- 22:89a1202125bc
- Child:
- 25:d53190a4ae96
File content as of revision 24:739e3a700d34:
#include "mbed.h" #include "mDot.h" #include "CommandTerminal.h" #include "ATSerial.h" #include "ATSerialFlowControl.h" #include "ChannelPlans.h" #define SERIAL_BUFFER_SIZE 512 mts::ATSerial debug(USBTX, USBRX); #ifndef UNIT_TEST #ifndef CHANNEL_PLAN #define CHANNEL_PLAN CP_KR920 #endif int main() { debug.baud(115200); // get a mDot handle mDot* dot = mDot::getInstance(); #if CHANNEL_PLAN == CP_AS923 lora::ChannelPlan* plan = new lora::CustomChannelPlan_AS923(*dot->getRadio(), *dot->getSettings()); #elif CHANNEL_PLAN == CP_US915 lora::ChannelPlan* plan = new lora::CustomChannelPlan_US915(*dot->getRadio(), *dot->getSettings()); #elif CHANNEL_PLAN == CP_AU915 lora::ChannelPlan* plan = new lora::CustomChannelPlan_AU915(*dot->getRadio(), *dot->getSettings()); #elif CHANNEL_PLAN == CP_EU868 lora::ChannelPlan* plan = new lora::CustomChannelPlan_EU868(*dot->getRadio(), *dot->getSettings()); #elif CHANNEL_PLAN == CP_KR920 lora::ChannelPlan* plan = new lora::CustomChannelPlan_KR920(*dot->getRadio(), *dot->getSettings()); #endif dot->setChannelPlan(plan); // Seed the RNG srand(dot->getRadioRandom()); mts::ATSerial* serial; if (dot->getFlowControl()) #if defined(TARGET_MTS_MDOT_F411RE) serial = new mts::ATSerialFlowControl(XBEE_DOUT, XBEE_DIN, XBEE_RTS, XBEE_CTS, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); #else serial = new mts::ATSerialFlowControl(UART1_TX, UART1_RX, UART1_RTS, UART1_CTS, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); #endif else #if defined(TARGET_MTS_MDOT_F411RE) serial = new mts::ATSerial(XBEE_DOUT, XBEE_DIN, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); #else serial = new mts::ATSerial(UART1_TX, UART1_RX, SERIAL_BUFFER_SIZE, SERIAL_BUFFER_SIZE); #endif debug.baud(dot->getDebugBaud()); serial->baud(dot->getBaud()); CommandTerminal term(*serial); CommandTerminal::_dot = dot; term.init(); term.start(); } #endif // UNIT_TEST