Skip to content

Commit 493475e

Browse files
committed
added commands to print device ID and firmware version
1 parent f29dabd commit 493475e

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

docs/relnotes/rn_v010200.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ The following commands are supported:
7878
| !sdcard | Output the current SD card usage statistics |
7979
| !systime | Output current system time |
8080
| !uptime | The uptime of the device |
81+
| !device-id | The ID for the device |
82+
| !version | The version of the firmware |
8183
| !wifi | Output current system WiFi state |
8284

8385
#### Log Data Rate

sfeDataLoggerIoT/sfeDLCommands.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,41 @@ class sfeDLCommands
422422

423423
return true;
424424
}
425+
426+
//---------------------------------------------------------------------
427+
///
428+
/// @brief output the firmware version
429+
///
430+
/// @param dlApp Pointer to the DataLogger App
431+
/// @retval bool indicates success (true) or failure (!true)
432+
///
433+
bool printVersion(sfeDataLogger *dlApp)
434+
{
435+
436+
char szBuffer[128];
437+
flux.versionString(szBuffer, sizeof(szBuffer), true);
438+
439+
flxLog_I("%s %s", flux.name(), flux.description());
440+
flxLog_I("Version: %s\n\r", szBuffer);
441+
442+
return true;
443+
}
444+
445+
//---------------------------------------------------------------------
446+
///
447+
/// @brief output the device ID
448+
///
449+
/// @param dlApp Pointer to the DataLogger App
450+
/// @retval bool indicates success (true) or failure (!true)
451+
///
452+
bool printDeviceID(sfeDataLogger *dlApp)
453+
{
454+
455+
flxLog_I("Device ID: %s", flux.deviceId());
456+
457+
return true;
458+
}
459+
425460
//---------------------------------------------------------------------
426461
// our command map - command name to callback method
427462
commandMap_t _commandMap = {
@@ -446,6 +481,8 @@ class sfeDLCommands
446481
{"verbose-output", &sfeDLCommands::logLevelVerbose},
447482
{"systime", &sfeDLCommands::outputSystemTime},
448483
{"uptime", &sfeDLCommands::outputUpTime},
484+
{"device-id", &sfeDLCommands::printDeviceID},
485+
{"version", &sfeDLCommands::printVersion},
449486
{"about", &sfeDLCommands::aboutDevice},
450487
{"help", &sfeDLCommands::helpDevice},
451488
};

0 commit comments

Comments
 (0)