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: MTS-Serial libmDot-mbed5
Fork of Dot-AT-Firmware by
CmdRxInverted.cpp
00001 #include "CmdRxInverted.h" 00002 00003 CmdRxInverted::CmdRxInverted() : 00004 Command("Set Rx inverted", "AT+RXI", "Set Rx signal inverted, (default:on)", "(0,1)") 00005 { 00006 _queryable = true; 00007 } 00008 00009 uint32_t CmdRxInverted::action(std::vector<std::string> args) 00010 { 00011 if (args.size() == 1) 00012 { 00013 CommandTerminal::Serial()->writef("%d\r\n", CommandTerminal::Dot()->getRxInverted()); 00014 } 00015 else if (args.size() == 2) 00016 { 00017 00018 bool invert = args[1] == "1"; 00019 if (CommandTerminal::Dot()->setRxInverted(invert) != mDot::MDOT_OK) 00020 { 00021 CommandTerminal::setErrorMessage(CommandTerminal::Dot()->getLastError());; 00022 return 1; 00023 } 00024 } 00025 00026 return 0; 00027 } 00028 00029 bool CmdRxInverted::verify(std::vector<std::string> args) 00030 { 00031 if (args.size() == 1) 00032 return true; 00033 00034 if (args.size() == 2) 00035 { 00036 if (!(args[1] == "0" || args[1] == "1")) { 00037 CommandTerminal::setErrorMessage("Invalid parameter, expects (0: off, 1: on)"); 00038 return false; 00039 } 00040 00041 return true; 00042 } 00043 00044 CommandTerminal::setErrorMessage("Invalid arguments"); 00045 return false; 00046 }
Generated on Tue Jul 12 2022 20:40:04 by
