2020-12-05 02:00:46 +00:00
|
|
|
#pragma once
|
2020-12-05 02:14:15 +00:00
|
|
|
#include "SinglePortPlugin.h"
|
2020-11-28 04:10:19 +00:00
|
|
|
#include "Observer.h"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Text message handling for meshtastic - draws on the OLED display the most recent received message
|
|
|
|
*/
|
2020-12-05 02:14:15 +00:00
|
|
|
class TextMessagePlugin : public SinglePortPlugin, public Observable<const MeshPacket *>
|
2020-11-28 04:10:19 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Constructor
|
|
|
|
* name is for debugging output
|
|
|
|
*/
|
2020-12-05 02:14:15 +00:00
|
|
|
TextMessagePlugin() : SinglePortPlugin("text", PortNum_TEXT_MESSAGE_APP) {}
|
2020-11-28 04:10:19 +00:00
|
|
|
|
2020-11-28 05:51:51 +00:00
|
|
|
protected:
|
2020-11-28 04:10:19 +00:00
|
|
|
|
|
|
|
/** Called to handle a particular incoming message
|
|
|
|
|
2021-09-23 01:42:09 +00:00
|
|
|
@return ProcessMessage::STOP if you've guaranteed you've handled this message and no other handlers should be considered for it
|
2020-11-28 04:10:19 +00:00
|
|
|
*/
|
2021-09-23 01:42:09 +00:00
|
|
|
virtual ProcessMessage handleReceived(const MeshPacket &mp);
|
2020-11-28 04:10:19 +00:00
|
|
|
};
|
|
|
|
|
2021-01-08 05:15:49 +00:00
|
|
|
extern TextMessagePlugin *textMessagePlugin;
|