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
CmdPing.cpp
00001 #include "CmdPing.h" 00002 00003 CmdPing::CmdPing() : Command("Send Ping", "AT+PING", "Sends ping and displays the servers received rssi and snr", "(-140-0),(-20.0-20.0)") 00004 { 00005 } 00006 00007 uint32_t CmdPing::action(std::vector<std::string> args) 00008 { 00009 mDot::ping_response response; 00010 response = CommandTerminal::Dot()->ping(); 00011 if (response.status != mDot::MDOT_OK) { 00012 std::string error = mDot::getReturnCodeString(response.status); 00013 00014 if (response.status != mDot::MDOT_NOT_JOINED) 00015 error += + " - " + CommandTerminal::Dot()->getLastError(); 00016 00017 CommandTerminal::setErrorMessage(CommandTerminal::Dot()->getLastError());; 00018 return 1; 00019 } 00020 00021 CommandTerminal::Serial()->writef("%d,%d.%d\r\n", response.rssi, response.snr / 10, abs(response.snr) % 10); 00022 00023 return 0; 00024 } 00025
Generated on Tue Jul 12 2022 20:40:04 by
