mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-25 09:42:35 +00:00
fix cppcheck complaints
This commit is contained in:
parent
fb41b0f5c8
commit
30240ac14b
@ -1 +1 @@
|
||||
Subproject commit 8f3972e579b09c7f4682f49c609a88e9d0ee2097
|
||||
Subproject commit 0985b94c20287552daf63831fd9eda4e0ed1bd0e
|
@ -28,6 +28,8 @@ typedef enum _StoreAndForward_RequestResponse {
|
||||
StoreAndForward_RequestResponse_ROUTER_BUSY = 5,
|
||||
/* Router is responding to a request for history. */
|
||||
StoreAndForward_RequestResponse_ROUTER_HISTORY = 6,
|
||||
/* Router is responding to a request for stats. */
|
||||
StoreAndForward_RequestResponse_ROUTER_STATS = 7,
|
||||
/* Client is an in error state. */
|
||||
StoreAndForward_RequestResponse_CLIENT_ERROR = 64,
|
||||
/* Client has requested a replay from the router. */
|
||||
|
@ -42,8 +42,9 @@ int32_t StoreForwardModule::runOnce()
|
||||
} else if ((millis() - lastHeartbeat > (heartbeatInterval * 1000)) && (airTime->channelUtilizationPercent() < polite_channel_util_percent)) {
|
||||
lastHeartbeat = millis();
|
||||
DEBUG_MSG("*** Sending heartbeat\n");
|
||||
StoreAndForward sf;
|
||||
StoreAndForward sf = StoreAndForward_init_zero;
|
||||
sf.rr = StoreAndForward_RequestResponse_ROUTER_HEARTBEAT;
|
||||
sf.which_variant = StoreAndForward_heartbeat_tag;
|
||||
sf.variant.heartbeat.period = 300;
|
||||
sf.variant.heartbeat.secondary = 0; // TODO we always have one primary router for now
|
||||
storeForwardModule->sendMessage(NODENUM_BROADCAST, sf);
|
||||
@ -181,7 +182,7 @@ void StoreForwardModule::sendPayload(NodeNum dest, uint32_t packetHistory_index)
|
||||
service.sendToMesh(p);
|
||||
}
|
||||
|
||||
void StoreForwardModule::sendMessage(NodeNum dest, StoreAndForward payload)
|
||||
void StoreForwardModule::sendMessage(NodeNum dest, StoreAndForward &payload)
|
||||
{
|
||||
MeshPacket *p = allocDataProtobuf(payload);
|
||||
|
||||
@ -205,8 +206,9 @@ void StoreForwardModule::sendMessage(NodeNum dest, StoreAndForward payload)
|
||||
|
||||
void StoreForwardModule::statsSend(uint32_t to)
|
||||
{
|
||||
StoreAndForward sf;
|
||||
StoreAndForward sf = StoreAndForward_init_zero;
|
||||
|
||||
sf.rr = StoreAndForward_RequestResponse_ROUTER_STATS;
|
||||
sf.which_variant = StoreAndForward_stats_tag;
|
||||
sf.variant.stats.messages_total = this->packetHistoryMax;
|
||||
sf.variant.stats.messages_saved = this->packetHistoryCurrent;
|
||||
|
@ -57,7 +57,7 @@ class StoreForwardModule : private concurrency::OSThread, public ProtobufModule<
|
||||
* Send our payload into the mesh
|
||||
*/
|
||||
void sendPayload(NodeNum dest = NODENUM_BROADCAST, uint32_t packetHistory_index = 0);
|
||||
void sendMessage(NodeNum dest, StoreAndForward payload);
|
||||
void sendMessage(NodeNum dest, StoreAndForward &payload);
|
||||
virtual MeshPacket *allocReply() override;
|
||||
/*
|
||||
-Override the wantPacket method.
|
||||
|
Loading…
Reference in New Issue
Block a user