mirror of
https://github.com/meshtastic/firmware.git
synced 2025-12-21 10:12:50 +00:00
add remote gpio control as an example plugin
https://github.com/meshtastic/Meshtastic-device/issues/182
This commit is contained in:
24
src/plugins/RemoteHardwarePlugin.h
Normal file
24
src/plugins/RemoteHardwarePlugin.h
Normal 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;
|
||||
Reference in New Issue
Block a user