mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 10:12:50 +00:00
cleanup virtual inheritence for Router/Reliable/Flooding/DSR
This commit is contained in:
@@ -67,14 +67,12 @@ class Router
|
||||
virtual ErrorCode send(MeshPacket *p);
|
||||
|
||||
/**
|
||||
* Called from loop()
|
||||
* Handle any packet that is received by an interface on this node.
|
||||
* Note: some packets may merely being passed through this node and will be forwarded elsewhere.
|
||||
* Should this incoming filter be dropped?
|
||||
*
|
||||
* Note: this packet will never be called for messages sent/generated by this node.
|
||||
* Note: this method will free the provided packet.
|
||||
* Called immedately on receiption, before any further processing.
|
||||
* @return true to abandon the packet
|
||||
*/
|
||||
virtual void handleReceived(MeshPacket *p);
|
||||
virtual bool shouldFilterReceived(const MeshPacket *p) { return false; }
|
||||
|
||||
/**
|
||||
* Every (non duplicate) packet this node receives will be passed through this method. This allows subclasses to
|
||||
@@ -88,6 +86,27 @@ class Router
|
||||
* @return true for success, false for corrupt packet.
|
||||
*/
|
||||
bool perhapsDecode(MeshPacket *p);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Called from loop()
|
||||
* Handle any packet that is received by an interface on this node.
|
||||
* Note: some packets may merely being passed through this node and will be forwarded elsewhere.
|
||||
*
|
||||
* Note: this packet will never be called for messages sent/generated by this node.
|
||||
* Note: this method will free the provided packet.
|
||||
*/
|
||||
void perhapsHandleReceived(MeshPacket *p);
|
||||
|
||||
/**
|
||||
* Called from perhapsHandleReceived() - allows subclass message delivery behavior.
|
||||
* Handle any packet that is received by an interface on this node.
|
||||
* Note: some packets may merely being passed through this node and will be forwarded elsewhere.
|
||||
*
|
||||
* Note: this packet will never be called for messages sent/generated by this node.
|
||||
* Note: this method will free the provided packet.
|
||||
*/
|
||||
void handleReceived(MeshPacket *p);
|
||||
};
|
||||
|
||||
extern Router &router;
|
||||
|
||||
Reference in New Issue
Block a user