begin plugin-api tutorial

This commit is contained in:
Kevin Hester
2020-12-11 09:11:53 +08:00
parent c361c1fab7
commit b9f1ce70cb
14 changed files with 166 additions and 40 deletions

23
src/plugins/ReplyPlugin.h Normal file
View File

@@ -0,0 +1,23 @@
#pragma once
#include "SinglePortPlugin.h"
/**
* A simple example plugin that just replies with "Message received" to any message it receives.
*/
class ReplyPlugin : public SinglePortPlugin
{
public:
/** Constructor
* name is for debugging output
*/
ReplyPlugin() : SinglePortPlugin("reply", PortNum_REPLY_APP) {}
protected:
/** 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 handleReceived(const MeshPacket &mp);
};