2021-01-27 19:18:16 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "SinglePortPlugin.h"
|
|
|
|
|
#include "concurrency/OSThread.h"
|
|
|
|
|
#include "configuration.h"
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <functional>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ExternalNotificationPlugin : private concurrency::OSThread
|
|
|
|
|
{
|
|
|
|
|
bool firstTime = 1;
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
ExternalNotificationPlugin();
|
|
|
|
|
|
2021-01-27 20:06:39 -08:00
|
|
|
void setExternalOn();
|
|
|
|
|
void setExternalOff();
|
2021-01-27 21:20:18 -08:00
|
|
|
void getExternal();
|
2021-01-27 20:06:39 -08:00
|
|
|
|
2021-01-27 19:18:16 -08:00
|
|
|
protected:
|
|
|
|
|
virtual int32_t runOnce();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern ExternalNotificationPlugin *externalNotificationPlugin;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* Radio interface for ExternalNotificationPlugin
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
class ExternalNotificationPluginRadio : public SinglePortPlugin
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public:
|
2021-03-13 13:14:27 +08:00
|
|
|
ExternalNotificationPluginRadio();
|
2021-01-27 19:18:16 -08:00
|
|
|
|
|
|
|
|
protected:
|
2021-01-28 23:02:00 -08:00
|
|
|
//virtual MeshPacket *allocReply();
|
2021-01-27 19:18:16 -08:00
|
|
|
|
|
|
|
|
/** 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);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
extern ExternalNotificationPluginRadio *externalNotificationPluginRadio;
|