Skip to content

Commit

Permalink
added commands to print device ID and firmware version
Browse files Browse the repository at this point in the history
  • Loading branch information
gigapod committed Mar 15, 2024
1 parent f29dabd commit 493475e
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/relnotes/rn_v010200.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 37 additions & 0 deletions sfeDataLoggerIoT/sfeDLCommands.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -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},
};
Expand Down

0 comments on commit 493475e

Please sign in to comment.