diff --git a/docs/relnotes/rn_v010200.md b/docs/relnotes/rn_v010200.md index 9901296..7f69f7c 100644 --- a/docs/relnotes/rn_v010200.md +++ b/docs/relnotes/rn_v010200.md @@ -78,6 +78,8 @@ The following commands are supported: | !sdcard | Output the current SD card usage statistics | | !systime | Output current system time | | !uptime | The uptime of the device | +| !device-id | The ID for the device | +| !version | The version of the firmware | | !wifi | Output current system WiFi state | #### Log Data Rate diff --git a/sfeDataLoggerIoT/sfeDLCommands.h b/sfeDataLoggerIoT/sfeDLCommands.h index 6d65bb0..df5e9ba 100644 --- a/sfeDataLoggerIoT/sfeDLCommands.h +++ b/sfeDataLoggerIoT/sfeDLCommands.h @@ -422,6 +422,41 @@ class sfeDLCommands return true; } + + //--------------------------------------------------------------------- + /// + /// @brief output the firmware version + /// + /// @param dlApp Pointer to the DataLogger App + /// @retval bool indicates success (true) or failure (!true) + /// + bool printVersion(sfeDataLogger *dlApp) + { + + char szBuffer[128]; + flux.versionString(szBuffer, sizeof(szBuffer), true); + + flxLog_I("%s %s", flux.name(), flux.description()); + flxLog_I("Version: %s\n\r", szBuffer); + + return true; + } + + //--------------------------------------------------------------------- + /// + /// @brief output the device ID + /// + /// @param dlApp Pointer to the DataLogger App + /// @retval bool indicates success (true) or failure (!true) + /// + bool printDeviceID(sfeDataLogger *dlApp) + { + + flxLog_I("Device ID: %s", flux.deviceId()); + + return true; + } + //--------------------------------------------------------------------- // our command map - command name to callback method commandMap_t _commandMap = { @@ -446,6 +481,8 @@ class sfeDLCommands {"verbose-output", &sfeDLCommands::logLevelVerbose}, {"systime", &sfeDLCommands::outputSystemTime}, {"uptime", &sfeDLCommands::outputUpTime}, + {"device-id", &sfeDLCommands::printDeviceID}, + {"version", &sfeDLCommands::printVersion}, {"about", &sfeDLCommands::aboutDevice}, {"help", &sfeDLCommands::helpDevice}, };