with 36errors
Dependencies: MTS-Serial libxDot-dev-mbed5-deprecated
Fork of Dot-AT-Firmware by
CmdTxInverted.cpp
00001 #include "CmdTxInverted.h" 00002 00003 CmdTxInverted::CmdTxInverted() : 00004 Command("Set Tx inverted", "AT+TXI", "Set Tx signal inverted, (default:off)", "(0,1)") 00005 { 00006 _queryable = true; 00007 } 00008 00009 uint32_t CmdTxInverted::action(std::vector<std::string> args) 00010 { 00011 if (args.size() == 1) 00012 { 00013 CommandTerminal::Serial()->writef("%d\r\n", CommandTerminal::Dot()->getTxInverted()); 00014 } 00015 else if (args.size() == 2) 00016 { 00017 bool invert = args[1] == "1"; 00018 if (CommandTerminal::Dot()->setTxInverted(invert) != mDot::MDOT_OK) 00019 { 00020 CommandTerminal::setErrorMessage(CommandTerminal::Dot()->getLastError());; 00021 return 1; 00022 } 00023 } 00024 00025 return 0; 00026 } 00027 00028 bool CmdTxInverted::verify(std::vector<std::string> args) 00029 { 00030 if (args.size() == 1) 00031 return true; 00032 00033 if (args.size() == 2) 00034 { 00035 if (!(args[1] == "0" || args[1] == "1")) { 00036 CommandTerminal::setErrorMessage("Invalid parameter, expects (0: off, 1: on)"); 00037 return false; 00038 } 00039 00040 return true; 00041 } 00042 00043 CommandTerminal::setErrorMessage("Invalid arguments"); 00044 return false; 00045 } 00046
Generated on Wed Jul 13 2022 06:20:59 by
1.7.2
