add remote gpio control as an example plugin

https://github.com/meshtastic/Meshtastic-device/issues/182
This commit is contained in:
Kevin Hester
2020-12-06 18:33:42 +08:00
parent 3e0dc44210
commit 8f5a1f19d3
8 changed files with 131 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
#pragma once
#include "ProtobufPlugin.h"
#include "remote_hardware.pb.h"
/**
* A plugin that provides easy low-level remote access to device hardware.
*/
class RemoteHardwarePlugin : public ProtobufPlugin<HardwareMessage>
{
public:
/** Constructor
* name is for debugging output
*/
RemoteHardwarePlugin() : ProtobufPlugin("remotehardware", PortNum_REMOTE_HARDWARE_APP, HardwareMessage_fields) {}
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 handleReceivedProtobuf(const MeshPacket &mp, const HardwareMessage &p);
};
extern RemoteHardwarePlugin remoteHardwarePlugin;