sforkowany z mirror/meshtastic-firmware
Partial work from laptop -- non-routers can send a heartbeat
rodzic
5f041ea7e9
commit
52d85c9a41
|
@ -66,12 +66,13 @@ int32_t StoreForwardPlugin::runOnce()
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DEBUG_MSG("Initializing Store & Forward Plugin - Enabled but is_router is not turned on.\n");
|
/*
|
||||||
DEBUG_MSG(
|
* If the plugin is turned on and is_router is not enabled, then we'll send a heartbeat every
|
||||||
"Initializing Store & Forward Plugin - If you want to use this plugin, you must also turn on is_router.\n");
|
* few minutes.
|
||||||
// Non-Router
|
*/
|
||||||
|
storeForwardPluginRadio->sendPayloadHeartbeat();
|
||||||
|
|
||||||
return (30 * 1000);
|
return (3 * 60 * 1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
@ -235,6 +236,15 @@ void StoreForwardPluginRadio::sendPayload(NodeNum dest, bool wantReplies)
|
||||||
service.sendToMesh(p);
|
service.sendToMesh(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void StoreForwardPluginRadio::sendPayloadHeartbeat(NodeNum dest, bool wantReplies)
|
||||||
|
{
|
||||||
|
MeshPacket *p = allocReply();
|
||||||
|
p->to = dest;
|
||||||
|
p->decoded.want_response = wantReplies;
|
||||||
|
|
||||||
|
service.sendToMesh(p);
|
||||||
|
}
|
||||||
|
|
||||||
bool StoreForwardPluginRadio::handleReceived(const MeshPacket &mp)
|
bool StoreForwardPluginRadio::handleReceived(const MeshPacket &mp)
|
||||||
{
|
{
|
||||||
#ifndef NO_ESP32
|
#ifndef NO_ESP32
|
||||||
|
|
|
@ -63,6 +63,11 @@ class StoreForwardPluginRadio : public SinglePortPlugin
|
||||||
*/
|
*/
|
||||||
void sendPayload(NodeNum dest = NODENUM_BROADCAST, bool wantReplies = false);
|
void sendPayload(NodeNum dest = NODENUM_BROADCAST, bool wantReplies = false);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Send our payload into the mesh
|
||||||
|
*/
|
||||||
|
void sendPayloadHeartbeat(NodeNum dest = NODENUM_BROADCAST, bool wantReplies = false);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual MeshPacket *allocReply();
|
virtual MeshPacket *allocReply();
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue