Jason Reiss / Mbed OS Dot-AT-Firmware-XDOT

Dependencies:   MTS-Serial libxDot-mbed5

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers CmdFrequencyBand.cpp Source File

CmdFrequencyBand.cpp

00001 #include "CmdFrequencyBand.h"
00002 
00003 CmdFrequencyBand::CmdFrequencyBand() :
00004         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)")
00005 {
00006     _queryable = true;
00007 }
00008 
00009 uint32_t CmdFrequencyBand::action(std::vector<std::string> args)
00010                                   {
00011     if (args.size() == 1)
00012     {
00013         // using getChannelPlanName here instead of mDot::FrequencyBandStr allows AT firmware to properly display custom channel plan names
00014         CommandTerminal::Serial()->writef("%s\r\n", CommandTerminal::Dot()->getChannelPlanName().c_str());
00015     }
00016 
00017     return 0;
00018 }
00019 
00020 bool CmdFrequencyBand::verify(std::vector<std::string> args)
00021                               {
00022     if (args.size() == 1)
00023         return true;
00024 
00025     CommandTerminal::setErrorMessage("Invalid arguments");
00026     return false;
00027 }