2020-12-05 02:00:46 +00:00
|
|
|
#pragma once
|
2020-11-28 04:10:19 +00:00
|
|
|
#include "Observer.h"
|
2023-01-21 13:34:29 +00:00
|
|
|
#include "SinglePortModule.h"
|
2020-11-28 04:10:19 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Text message handling for meshtastic - draws on the OLED display the most recent received message
|
|
|
|
*/
|
2023-01-21 17:22:19 +00:00
|
|
|
class TextMessageModule : public SinglePortModule, public Observable<const meshtastic_MeshPacket *>
|
2020-11-28 04:10:19 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Constructor
|
|
|
|
* name is for debugging output
|
|
|
|
*/
|
2023-01-21 17:22:19 +00:00
|
|
|
TextMessageModule() : SinglePortModule("text", meshtastic_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
|
|
|
|
|
2023-01-21 13:34:29 +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
|
|
|
*/
|
2023-01-21 17:22:19 +00:00
|
|
|
virtual ProcessMessage handleReceived(const meshtastic_MeshPacket &mp) override;
|
2020-11-28 04:10:19 +00:00
|
|
|
};
|
|
|
|
|
2022-02-27 10:21:02 +00:00
|
|
|
extern TextMessageModule *textMessageModule;
|