Factory firmware for the MultiTech Dotbox (MTDOT-BOX) and EVB (MTDOT-EVB) products.
Dependencies: NCP5623B GpsParser ISL29011 libmDot-mbed5 MTS-Serial MMA845x DOGS102 MPL3115A2
CmdDisplayConfig.cpp
00001 /* Copyright (c) <2016> <MultiTech Systems>, MIT License 00002 * 00003 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software 00004 * and associated documentation files (the "Software"), to deal in the Software without restriction, 00005 * including without limitation the rights to use, copy, modify, merge, publish, distribute, 00006 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 00007 * furnished to do so, subject to the following conditions: 00008 * 00009 * The above copyright notice and this permission notice shall be included in all copies or 00010 * substantial portions of the Software. 00011 * 00012 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 00013 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 00014 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00015 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00016 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00017 */ 00018 00019 #include "CmdDisplayConfig.h" 00020 #include "dotbox_version.h" 00021 #include "MTSLog.h" 00022 00023 std::string version = MTDOT_BOX_VERSION; 00024 00025 CmdDisplayConfig::CmdDisplayConfig(mDot* dot, mts::MTSSerial& serial) 00026 : 00027 Command(dot, "Display Settings", "AT&V", "Displays current settings and status"), 00028 _serial(serial) { 00029 _help = std::string(text()) + ": " + std::string(desc()); 00030 _usage = "TABLE"; 00031 } 00032 00033 uint32_t CmdDisplayConfig::action(std::vector<std::string> args) { 00034 _serial.writef("Firmware: \t\t%s\r\n", version.c_str()); 00035 _serial.writef("Library : \t\t%s\r\n", _dot->getId().c_str()); 00036 00037 _serial.writef("Device ID:\t\t"); 00038 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getDeviceId(), ":").c_str()); 00039 00040 _serial.writef("Frequency Band:\t\t%s\r\n", mDot::FrequencyBandStr(_dot->getFrequencyBand()).c_str()); 00041 if (lora::ChannelPlan::IsPlanFixed(_dot->getFrequencyBand())) 00042 _serial.writef("Frequency Sub Band:\t%u\r\n", _dot->getFrequencySubBand()); 00043 00044 std::string network_mode("Undefined"); 00045 uint8_t network_type = _dot->getPublicNetwork(); 00046 if (network_type == lora::PRIVATE_MTS) 00047 network_mode = "Private MTS"; 00048 else if (network_type == lora::PUBLIC_LORAWAN) 00049 network_mode = "Public LoRaWAN"; 00050 else if (network_type == lora::PRIVATE_LORAWAN) 00051 network_mode = "Private LoRaWAN"; 00052 else if (network_type == lora::PEER_TO_PEER) 00053 network_mode = "Peer to Peer"; 00054 _serial.writef("Public Network:\t\t%s\r\n", network_mode.c_str()); 00055 00056 _serial.writef("Join Delay:\t\t%u seconds\r\n", _dot->getJoinDelay()); 00057 00058 _serial.writef("Network Address:\t%s\r\n", mts::Text::bin2hexString(_dot->getNetworkAddress()).c_str()); 00059 00060 _serial.writef("Network ID:\t\t"); 00061 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getNetworkId(), ":").c_str()); 00062 00063 _serial.writef("Network ID Passphrase:\t%s\r\n", _dot->getNetworkName().c_str()); 00064 00065 _serial.writef("Network Key:\t\t"); 00066 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getNetworkKey(), ".").c_str()); 00067 00068 _serial.writef("Network Key Passphrase:\t%s\r\n", _dot->getNetworkPassphrase().c_str()); 00069 00070 _serial.writef("Network Session Key:\t"); 00071 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getNetworkSessionKey(), ".").c_str()); 00072 00073 _serial.writef("Data Session Key:\t"); 00074 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getDataSessionKey(), ".").c_str()); 00075 00076 _serial.writef("Network Join Mode:\t%s\r\n", mDot::JoinModeStr(_dot->getJoinMode()).c_str()); 00077 00078 _serial.writef("Tx Data Rate:\t\t%s\r\n", mDot::DataRateStr(_dot->getTxDataRate()).c_str()); 00079 _serial.writef("Tx Power:\t\t%u\r\n", _dot->getTxPower()); 00080 _serial.writef("Log Level:\t\t%u\r\n", _dot->getLogLevel()); 00081 00082 _serial.writef("Maximum Size:\t\t%u\r\n", _dot->getWakeDelay()); //DotBox +MaxSize is stored here. 00083 _serial.writef("Minimum Size:\t\t%u\r\n", _dot->getWakeInterval()); //DotBox +MinSize is stored here. 00084 _serial.writef("Maximum Power:\t\t%u\r\n", _dot->getWakeMode()); //DotBox +MaxPwr is stored here. 00085 _serial.writef("Minimum Power:\t\t%u\r\n", _dot->getWakeTimeout()); //DotBox +MinPwr is stored here. 00086 _serial.writef("Data:\t\t\t%d\r\n", _dot->getStartUpMode()); //DotBox +Data is stored here. 00087 00088 00089 return 0; 00090 } 00091
Generated on Tue Jul 12 2022 17:02:17 by 1.7.2