Updated to libmDot 1.0.8-1

Dependencies:   DOGS102 GpsParser ISL29011 MMA845x MPL3115A2 MTS-Serial NCP5623B libmDot mbed-rtos mbed

Fork of MTDOT-BOX-EVB-Factory-Firmware by MultiTech

Committer:
jreiss
Date:
Wed Jul 13 19:14:04 2016 +0000
Revision:
6:ab581c4260e7
Parent:
1:71125aa00e33
Use DR enum values instead of SF values

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Mike Fiore 1:71125aa00e33 1 /* Copyright (c) <2016> <MultiTech Systems>, MIT License
Mike Fiore 1:71125aa00e33 2 *
Mike Fiore 1:71125aa00e33 3 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
Mike Fiore 1:71125aa00e33 4 * and associated documentation files (the "Software"), to deal in the Software without restriction,
Mike Fiore 1:71125aa00e33 5 * including without limitation the rights to use, copy, modify, merge, publish, distribute,
Mike Fiore 1:71125aa00e33 6 * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
Mike Fiore 1:71125aa00e33 7 * furnished to do so, subject to the following conditions:
Mike Fiore 1:71125aa00e33 8 *
Mike Fiore 1:71125aa00e33 9 * The above copyright notice and this permission notice shall be included in all copies or
Mike Fiore 1:71125aa00e33 10 * substantial portions of the Software.
Mike Fiore 1:71125aa00e33 11 *
Mike Fiore 1:71125aa00e33 12 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
Mike Fiore 1:71125aa00e33 13 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Mike Fiore 1:71125aa00e33 14 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
Mike Fiore 1:71125aa00e33 15 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
Mike Fiore 1:71125aa00e33 16 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Mike Fiore 1:71125aa00e33 17 */
Mike Fiore 1:71125aa00e33 18
Mike Fiore 1:71125aa00e33 19 #include "CmdDisplayConfig.h"
Mike Fiore 1:71125aa00e33 20 #include "version.h"
Mike Fiore 1:71125aa00e33 21 #include "MTSLog.h"
Mike Fiore 1:71125aa00e33 22
Mike Fiore 1:71125aa00e33 23 std::string version = MTDOT_BOX_VERSION;
Mike Fiore 1:71125aa00e33 24
Mike Fiore 1:71125aa00e33 25 CmdDisplayConfig::CmdDisplayConfig(mDot* dot, mts::MTSSerial& serial)
Mike Fiore 1:71125aa00e33 26 :
Mike Fiore 1:71125aa00e33 27 Command(dot, "Display Settings", "AT&V", "Displays current settings and status"),
Mike Fiore 1:71125aa00e33 28 _serial(serial) {
Mike Fiore 1:71125aa00e33 29 _help = std::string(text()) + ": " + std::string(desc());
Mike Fiore 1:71125aa00e33 30 _usage = "TABLE";
Mike Fiore 1:71125aa00e33 31 }
Mike Fiore 1:71125aa00e33 32
Mike Fiore 1:71125aa00e33 33 uint32_t CmdDisplayConfig::action(std::vector<std::string> args) {
Mike Fiore 1:71125aa00e33 34 _serial.writef("Firmware: \t\t%s\r\n", version.c_str());
Mike Fiore 1:71125aa00e33 35 _serial.writef("Library : \t\t%s\r\n", _dot->getId().c_str());
Mike Fiore 1:71125aa00e33 36
Mike Fiore 1:71125aa00e33 37 _serial.writef("Device ID:\t\t");
Mike Fiore 1:71125aa00e33 38 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getDeviceId(), ":").c_str());
Mike Fiore 1:71125aa00e33 39
Mike Fiore 1:71125aa00e33 40 _serial.writef("Frequency Band:\t\t%s\r\n", mDot::FrequencyBandStr(_dot->getFrequencyBand()).c_str());
Mike Fiore 1:71125aa00e33 41 if (_dot->getFrequencyBand() == mDot::FB_915)
Mike Fiore 1:71125aa00e33 42 _serial.writef("Frequency Sub Band:\t%u\r\n", _dot->getFrequencySubBand());
Mike Fiore 1:71125aa00e33 43
Mike Fiore 1:71125aa00e33 44 _serial.writef("Public Network:\t\t%s\r\n", _dot->getPublicNetwork() ? "on" : "off");
Mike Fiore 1:71125aa00e33 45
Mike Fiore 1:71125aa00e33 46 _serial.writef("Network Address:\t%s\r\n", mts::Text::bin2hexString(_dot->getNetworkAddress()).c_str());
Mike Fiore 1:71125aa00e33 47
Mike Fiore 1:71125aa00e33 48 _serial.writef("Network ID:\t\t");
Mike Fiore 1:71125aa00e33 49 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getNetworkId(), ":").c_str());
Mike Fiore 1:71125aa00e33 50
Mike Fiore 1:71125aa00e33 51 _serial.writef("Network ID Passphrase:\t%s\r\n", _dot->getNetworkName().c_str());
Mike Fiore 1:71125aa00e33 52
Mike Fiore 1:71125aa00e33 53 _serial.writef("Network Key:\t\t");
Mike Fiore 1:71125aa00e33 54 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getNetworkKey(), ".").c_str());
Mike Fiore 1:71125aa00e33 55
Mike Fiore 1:71125aa00e33 56 _serial.writef("Network Key Passphrase:\t%s\r\n", _dot->getNetworkPassphrase().c_str());
Mike Fiore 1:71125aa00e33 57
Mike Fiore 1:71125aa00e33 58 _serial.writef("Network Session Key:\t");
Mike Fiore 1:71125aa00e33 59 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getNetworkSessionKey(), ".").c_str());
Mike Fiore 1:71125aa00e33 60
Mike Fiore 1:71125aa00e33 61 _serial.writef("Data Session Key:\t");
Mike Fiore 1:71125aa00e33 62 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getDataSessionKey(), ".").c_str());
Mike Fiore 1:71125aa00e33 63
Mike Fiore 1:71125aa00e33 64 _serial.writef("Network Join Mode:\t%s\r\n", mDot::JoinModeStr(_dot->getJoinMode()).c_str());
Mike Fiore 1:71125aa00e33 65
Mike Fiore 1:71125aa00e33 66 _serial.writef("Tx Data Rate:\t\t%s\r\n", mDot::DataRateStr(_dot->getTxDataRate()).c_str());
Mike Fiore 1:71125aa00e33 67 _serial.writef("Tx Power:\t\t%u\r\n", _dot->getTxPower());
Mike Fiore 1:71125aa00e33 68 //_serial.writef("Log Level:\t\t%ld\r\n", _dot->getLogLevel());
Mike Fiore 1:71125aa00e33 69 _serial.writef("Log Level:\t\t%ld\r\n", mts::MTSLog::TRACE_LEVEL);
Mike Fiore 1:71125aa00e33 70
Mike Fiore 1:71125aa00e33 71 _serial.writef("Maximum Size:\t\t%u\r\n", _dot->getWakeDelay()); //DotBox +MaxSize is stored here.
Mike Fiore 1:71125aa00e33 72 _serial.writef("Minimum Size:\t\t%u\r\n", _dot->getWakeInterval()); //DotBox +MinSize is stored here.
Mike Fiore 1:71125aa00e33 73 _serial.writef("Maximum Power:\t\t%u\r\n", _dot->getWakeMode()); //DotBox +MaxPwr is stored here.
Mike Fiore 1:71125aa00e33 74 _serial.writef("Minimum Power:\t\t%u\r\n", _dot->getWakeTimeout()); //DotBox +MinPwr is stored here.
Mike Fiore 1:71125aa00e33 75 _serial.writef("Data:\t\t\t%d\r\n", _dot->getStartUpMode()); //DotBox +Data is stored here.
Mike Fiore 1:71125aa00e33 76
Mike Fiore 1:71125aa00e33 77
Mike Fiore 1:71125aa00e33 78 return 0;
Mike Fiore 1:71125aa00e33 79 }
Mike Fiore 1:71125aa00e33 80