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 {
|
||||
DEBUG_MSG("Initializing Store & Forward Plugin - Enabled but is_router is not turned on.\n");
|
||||
DEBUG_MSG(
|
||||
"Initializing Store & Forward Plugin - If you want to use this plugin, you must also turn on is_router.\n");
|
||||
// Non-Router
|
||||
/*
|
||||
* If the plugin is turned on and is_router is not enabled, then we'll send a heartbeat every
|
||||
* few minutes.
|
||||
*/
|
||||
storeForwardPluginRadio->sendPayloadHeartbeat();
|
||||
|
||||
return (30 * 1000);
|
||||
return (3 * 60 * 1000);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
@ -235,6 +236,15 @@ void StoreForwardPluginRadio::sendPayload(NodeNum dest, bool wantReplies)
|
|||
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)
|
||||
{
|
||||
#ifndef NO_ESP32
|
||||
|
|
|
@ -63,6 +63,11 @@ class StoreForwardPluginRadio : public SinglePortPlugin
|
|||
*/
|
||||
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:
|
||||
virtual MeshPacket *allocReply();
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue