Add statistics commands and response handling in MyMesh
- Introduced new commands for retrieving statistics: CMD_GET_STATS_CORE, CMD_GET_STATS_RADIO, and CMD_GET_STATS_PACKETS. - Implemented corresponding response handling methods to format and send statistics data. - Updated MyMesh constructor to initialize new member variables for managing statistics. - Included StatsFormatHelper for formatting statistics replies.
This commit is contained in:
@@ -69,6 +69,7 @@
|
||||
|
||||
#include <helpers/BaseChatMesh.h>
|
||||
#include <helpers/TransportKeyStore.h>
|
||||
#include <helpers/StatsFormatHelper.h>
|
||||
|
||||
/* -------------------------------------------------------------------------------------- */
|
||||
|
||||
@@ -170,6 +171,11 @@ private:
|
||||
void checkCLIRescueCmd();
|
||||
void checkSerialInterface();
|
||||
|
||||
// Stats methods
|
||||
void formatStatsReply(char *reply);
|
||||
void formatRadioStatsReply(char *reply);
|
||||
void formatPacketStatsReply(char *reply);
|
||||
|
||||
// helpers, short-cuts
|
||||
void savePrefs() { _store->savePrefs(_prefs, sensors.node_lat, sensors.node_lon); }
|
||||
void saveChannels() { _store->saveChannels(this); }
|
||||
@@ -178,6 +184,8 @@ private:
|
||||
private:
|
||||
DataStore* _store;
|
||||
NodePrefs _prefs;
|
||||
mesh::PacketManager* _pkt_mgr; // stored for stats access
|
||||
mesh::MillisecondClock* _ms_clock; // stored for stats access
|
||||
uint32_t pending_login;
|
||||
uint32_t pending_status;
|
||||
uint32_t pending_telemetry, pending_discovery; // pending _TELEMETRY_REQ
|
||||
|
||||
Reference in New Issue
Block a user