mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-23 11:10:52 +00:00
WIP 1.2 move routing into plugin
This commit is contained in:
31
src/plugins/RoutingPlugin.h
Normal file
31
src/plugins/RoutingPlugin.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
#include "ProtobufPlugin.h"
|
||||
|
||||
/**
|
||||
* Routing plugin for router control messages
|
||||
*/
|
||||
class RoutingPlugin : public ProtobufPlugin<Routing>
|
||||
{
|
||||
public:
|
||||
/** Constructor
|
||||
* name is for debugging output
|
||||
*/
|
||||
RoutingPlugin();
|
||||
|
||||
protected:
|
||||
friend class Router;
|
||||
|
||||
/** Called to handle a particular incoming message
|
||||
|
||||
@return true if you've guaranteed you've handled this message and no other handlers should be considered for it
|
||||
*/
|
||||
virtual bool handleReceivedProtobuf(const MeshPacket &mp, const Routing &p);
|
||||
|
||||
/** Messages can be received that have the want_response bit set. If set, this callback will be invoked
|
||||
* so that subclasses can (optionally) send a response back to the original sender. */
|
||||
virtual MeshPacket *allocReply();
|
||||
|
||||
void sendAckNak(Routing_Error err, NodeNum to, PacketId idFrom);
|
||||
};
|
||||
|
||||
extern RoutingPlugin *routingPlugin;
|
||||
Reference in New Issue
Block a user