Skip to content

Commit c9aa536

Browse files
committed
Reverted MyMesh constructor for simplicity.
Updated formatStatsReply method to use new member variables for statistics handling. Removed excess variable creation
1 parent df4dab8 commit c9aa536

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

examples/companion_radio/MyMesh.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ uint32_t MyMesh::calcDirectTimeoutMillisFor(uint32_t pkt_airtime_millis, uint8_t
710710
void MyMesh::onSendTimeout() {}
711711

712712
MyMesh::MyMesh(mesh::Radio &radio, mesh::RNG &rng, mesh::RTCClock &rtc, SimpleMeshTables &tables, DataStore& store, AbstractUITask* ui)
713-
: BaseChatMesh(radio, *(_ms_clock = new ArduinoMillis()), rng, rtc, *(_pkt_mgr = new StaticPoolPacketManager(16)), tables),
713+
: BaseChatMesh(radio, *new ArduinoMillis(), rng, rtc, *new StaticPoolPacketManager(16), tables),
714714
_serial(NULL), telemetry(MAX_PACKET_PAYLOAD - 4), _store(&store), _ui(ui) {
715715
_iter_started = false;
716716
_cli_rescue = false;
@@ -1612,8 +1612,7 @@ void MyMesh::enterCLIRescue() {
16121612

16131613
void MyMesh::formatStatsReply(char *reply) {
16141614
// Use StatsFormatHelper
1615-
// Note: err_flags is private in Dispatcher, so we use 0
1616-
StatsFormatHelper::formatCoreStats(reply, board, *_ms_clock, 0, _pkt_mgr);
1615+
StatsFormatHelper::formatCoreStats(reply, board, *_ms, _err_flags, _mgr);
16171616
}
16181617

16191618
void MyMesh::formatRadioStatsReply(char *reply) {

examples/companion_radio/MyMesh.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,6 @@ class MyMesh : public BaseChatMesh, public DataStoreHost {
184184
private:
185185
DataStore* _store;
186186
NodePrefs _prefs;
187-
mesh::PacketManager* _pkt_mgr; // stored for stats access
188-
mesh::MillisecondClock* _ms_clock; // stored for stats access
189187
uint32_t pending_login;
190188
uint32_t pending_status;
191189
uint32_t pending_telemetry, pending_discovery; // pending _TELEMETRY_REQ

0 commit comments

Comments
 (0)