![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
AT terminal for the mDot using the USB debug port instead of the serial port.
Dependencies: MTS-Serial libmDot-mbed5
Fork of Dot-AT-Firmware by
Diff: CommandTerminal/CmdFrequencyBand.cpp
- Revision:
- 16:d5cf2af81a6d
- Parent:
- 14:f9a77400b622
--- a/CommandTerminal/CmdFrequencyBand.cpp Fri Nov 04 17:04:54 2016 -0500 +++ b/CommandTerminal/CmdFrequencyBand.cpp Mon Jun 19 14:33:21 2017 -0500 @@ -1,8 +1,7 @@ #include "CmdFrequencyBand.h" - CmdFrequencyBand::CmdFrequencyBand() : - Command("Frequency Band", "AT+FREQ", "Configured Frequency Band 'EU868', 'US915' or 'AU915'", "(EU868,US915,AU915)") + Command("Current Frequency Band", "AT+FREQ", "Current Frequency Band of Device 'US915', 'AU915', 'EU868', 'AS923', 'KR920', or 'AS923-JAPAN'", "(US915,AU915,EU868,AS923,KR920,AS923-JAPAN)") { _queryable = true; } @@ -11,33 +10,10 @@ { if (args.size() == 1) { - CommandTerminal::Serial()->writef("%s\r\n", mDot::FrequencyBandStr(CommandTerminal::Dot()->getFrequencyBand()).c_str()); + // using getChannelPlanName here instead of mDot::FrequencyBandStr allows AT firmware to properly display custom channel plan names + CommandTerminal::Serial()->writef("%s\r\n", CommandTerminal::Dot()->getChannelPlanName().c_str()); } -#ifdef DEBUG_MAC - else if (args.size() == 2) - { - uint8_t band = mDot::FB_US915; - std::string band_str = mts::Text::toUpper(args[1]); - - - if (mDot::FrequencyBandStr(mDot::FB_EU868).find(band_str) != std::string::npos) { - band = mDot::FB_EU868; - } - if (mDot::FrequencyBandStr(mDot::FB_AU915).find(band_str) != std::string::npos) { - band = mDot::FB_AU915; - } - if (mDot::FrequencyBandStr(mDot::FB_US915).find(band_str) != std::string::npos) { - band = mDot::FB_US915; - } - - if (CommandTerminal::Dot()->setFrequencyBand(band) != mDot::MDOT_OK) { - CommandTerminal::setErrorMessage(CommandTerminal::Dot()->getLastError());; - return 1; - } - } -#endif - return 0; } @@ -46,23 +22,6 @@ if (args.size() == 1) return true; -#ifdef DEBUG_MAC - if (args.size() == 2) - { - std::string band = mts::Text::toUpper(args[1]); - - if (mDot::FrequencyBandStr(mDot::FB_EU868).find(band) == std::string::npos && - mDot::FrequencyBandStr(mDot::FB_US915).find(band) == std::string::npos && - mDot::FrequencyBandStr(mDot::FB_AU915).find(band) == std::string::npos) - { - CommandTerminal::setErrorMessage("Invalid parameter, expects (EU868,US915,AU915)"); - return false; - } - - return true; - } -#endif - CommandTerminal::setErrorMessage("Invalid arguments"); return false; }