#include #include #include static bool globalStatsCmd(uint8_t argc, char **args) { uint32_t uptime = HAL_GetTick() / 1000; sendFormatString(\ "Current uptime: %ld\n\r" \ "\n\r", uptime ); t_deviceStats *deviceStats = getGlobalDeviceStats(); sendFormatString(\ "Global Device statistics\n\r" \ " Total running hours: %ld\n\r" \ " Total power cycles: %ld\n\r" \ " Total watchdog resets: %ld\n\r" \ "\n\r", deviceStats->totalRunningHours, deviceStats->totalPowercycles, deviceStats->totalWatchdogResets ); return true; } const cmd_t COMMANDS[] = { { .name = "stats", .cmdFunc = globalStatsCmd, .help = \ "stats .......................... Show the device statistics\n\r" }, { .name = "END_OF_CMDS", .help = "",.cmdFunc = NULL } }; const cmd_t *getRegularCommands() { return COMMANDS; }