properly route messages to phone again

This commit is contained in:
Kevin Hester
2021-02-23 14:35:34 +08:00
parent aa8b86c6b2
commit f8d8dc25c0
7 changed files with 31 additions and 14 deletions

View File

@@ -9,6 +9,7 @@ RoutingPlugin *routingPlugin;
bool RoutingPlugin::handleReceivedProtobuf(const MeshPacket &mp, const Routing *r)
{
DEBUG_MSG("Routing sniffing", &mp);
router->sniffReceived(&mp, r);
// FIXME - move this to a non promsicious PhoneAPI plugin?
@@ -23,8 +24,13 @@ bool RoutingPlugin::handleReceivedProtobuf(const MeshPacket &mp, const Routing *
MeshPacket *RoutingPlugin::allocReply()
{
assert(0); // 1.2 refactoring fixme, Not sure if anything needs this yet?
// return allocDataProtobuf(u);
assert(currentRequest);
// We only consider making replies if the request was a legit routing packet (not just something we were sniffing)
if(currentRequest->decoded.portnum == PortNum_ROUTING_APP) {
assert(0); // 1.2 refactoring fixme, Not sure if anything needs this yet?
// return allocDataProtobuf(u);
}
return NULL;
}

View File

@@ -25,6 +25,9 @@ class RoutingPlugin : public ProtobufPlugin<Routing>
* so that subclasses can (optionally) send a response back to the original sender. */
virtual MeshPacket *allocReply();
/// 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);
};