progress on remote settings

This commit is contained in:
Kevin Hester
2021-03-12 14:10:36 +08:00
parent 9d1971f0fa
commit b02212009a
12 changed files with 371 additions and 29 deletions

View File

@@ -66,6 +66,8 @@ bool AdminPlugin::handleReceivedProtobuf(const MeshPacket &mp, const AdminMessag
break;
default:
// Probably a message sent by us or sent to our local node. FIXME, we should avoid scanning these messages
DEBUG_MSG("Ignoring nonrelevant admin %d\n", r->which_variant);
break;
}
return false; // Let others look at this message also if they want

View File

@@ -35,7 +35,7 @@ MeshPacket *RoutingPlugin::allocReply()
return NULL;
}
void RoutingPlugin::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom)
void RoutingPlugin::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex)
{
Routing c = Routing_init_default;
@@ -47,6 +47,7 @@ void RoutingPlugin::sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom)
p->hop_limit = 0; // Assume just immediate neighbors for now
p->to = to;
p->decoded.request_id = idFrom;
p->channel = chIndex;
DEBUG_MSG("Sending an err=%d,to=0x%x,idFrom=0x%x,id=0x%x\n", err, to, idFrom, p->id);
router->sendLocal(p); // we sometimes send directly to the local node

View File

@@ -1,5 +1,6 @@
#pragma once
#include "ProtobufPlugin.h"
#include "Channels.h"
/**
* Routing plugin for router control messages
@@ -12,6 +13,8 @@ class RoutingPlugin : public ProtobufPlugin<Routing>
*/
RoutingPlugin();
void sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom, ChannelIndex chIndex);
protected:
friend class Router;
@@ -27,8 +30,6 @@ class RoutingPlugin : public ProtobufPlugin<Routing>
/// Override wantPacket to say we want to see all packets, not just those for our port number
virtual bool wantPacket(const MeshPacket *p) { return true; }
void sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom);
};
extern RoutingPlugin *routingPlugin;