make plugin reply handling simpler

This commit is contained in:
Kevin Hester
2020-12-13 12:57:37 +08:00
parent ad8bcba5ef
commit ee8f4de5ab
5 changed files with 29 additions and 15 deletions

View File

@@ -31,6 +31,15 @@ class MeshPlugin
protected:
const char *name;
/**
* If this plugin is currently handling a request currentRequest will be preset
* to the packet with the request. This is mostly useful for reply handlers.
*
* Note: this can be static because we are guaranteed to be processing only one
* plugin at a time.
*/
static const MeshPacket *currentRequest;
/**
* Initialize your plugin. This setup function is called once after all hardware and mesh protocol layers have
* been initialized