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 mbed-rtos mbed
Fork of mDot_USB_AT_firmware by
CmdDeviceId.cpp
00001 #include "CmdDeviceId.h" 00002 #include <algorithm> 00003 00004 CmdDeviceId::CmdDeviceId(mDot* dot, mts::MTSSerial& serial) : 00005 Command(dot, "Device ID", "AT+DI", "Device EUI-64 (MSB) (unique, set at factory) (8 bytes)"), _serial(serial) 00006 { 00007 _help = std::string(text()) + ": " + std::string(desc()); 00008 _usage = "(hex:8)"; 00009 _queryable = true; 00010 } 00011 00012 uint32_t CmdDeviceId::action(std::vector<std::string> args) 00013 { 00014 if (args.size() == 1) 00015 { 00016 if (_dot->getVerbose()) 00017 _serial.writef("%s: ", name()); 00018 _serial.writef("%s\r\n", mts::Text::bin2hexString(_dot->getDeviceId(), "-").c_str()); 00019 } 00020 00021 return 0; 00022 } 00023 00024 bool CmdDeviceId::verify(std::vector<std::string> args) 00025 { 00026 if (args.size() == 1) 00027 return true; 00028 00029 setErrorMessage("Invalid arguments"); 00030 return false; 00031 }
Generated on Tue Jul 12 2022 20:37:29 by
1.7.2
