Run Unit Tests / test (push) Canceled after 0s
Build and deploy Docs site to GitHub Pages / github-pages (push) Canceled after 0s
PR Build Check / build (Heltec_v3_companion_radio_ble) (push) Canceled after 0s
PR Build Check / build (Heltec_v3_repeater) (push) Canceled after 0s
PR Build Check / build (Heltec_v3_room_server) (push) Canceled after 0s
PR Build Check / build (LilyGo_Tlora_C6_repeater_) (push) Canceled after 0s
PR Build Check / build (PicoW_repeater) (push) Canceled after 0s
PR Build Check / build (RAK_4631_companion_radio_ble) (push) Canceled after 0s
PR Build Check / build (RAK_4631_companion_radio_ethernet) (push) Canceled after 0s
PR Build Check / build (RAK_4631_repeater) (push) Canceled after 0s
PR Build Check / build (RAK_4631_repeater_ethernet) (push) Canceled after 0s
PR Build Check / build (RAK_4631_room_server) (push) Canceled after 0s
PR Build Check / build (RAK_4631_room_server_ethernet) (push) Canceled after 0s
PR Build Check / build (Tbeam_SX1276_repeater) (push) Canceled after 0s
PR Build Check / build (wio-e5-mini_repeater) (push) Canceled after 0s
PR Build Check / build (wio_wm1110_repeater) (push) Canceled after 0s
52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
#pragma once
|
|
|
|
#include <MeshCore.h>
|
|
#include <helpers/ui/DisplayDriver.h>
|
|
#include <helpers/ui/UIScreen.h>
|
|
#include <helpers/SensorManager.h>
|
|
#include <helpers/MultiSerialInterface.h>
|
|
#include <Arduino.h>
|
|
|
|
#ifdef PIN_BUZZER
|
|
#include <helpers/ui/buzzer.h>
|
|
#endif
|
|
|
|
#include "NodePrefs.h"
|
|
|
|
enum class UIEventType {
|
|
none,
|
|
contactMessage,
|
|
channelMessage,
|
|
roomMessage,
|
|
newContactMessage,
|
|
ack
|
|
};
|
|
|
|
class AbstractUITask {
|
|
protected:
|
|
mesh::MainBoard* _board;
|
|
MultiSerialInterface* _interfaceManager;
|
|
bool _connected;
|
|
|
|
AbstractUITask(mesh::MainBoard* board, MultiSerialInterface* interfaceManager) : _board(board), _interfaceManager(interfaceManager) {
|
|
_connected = false;
|
|
}
|
|
|
|
public:
|
|
void setHasConnection(bool connected) { _connected = connected; }
|
|
bool hasConnection() const { return _connected; }
|
|
uint16_t getBattMilliVolts() const { return _board->getBattMilliVolts(); }
|
|
bool isBluetoothEnabled() const { return _interfaceManager->isBluetoothEnabled(); }
|
|
void enableBluetooth() { _interfaceManager->enableBluetooth(); }
|
|
void disableBluetooth() { _interfaceManager->disableBluetooth(); }
|
|
virtual void msgRead(int msgcount) = 0;
|
|
virtual void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount) = 0;
|
|
// То же, но без вывода на экран (тихий час или канал в режиме SILENT):
|
|
// сообщение попадает в непрочитанные, звука и всплытия нет.
|
|
virtual void newMsgSilent(uint8_t path_len, const char* from_name, const char* text, int msgcount) {
|
|
newMsg(path_len, from_name, text, msgcount);
|
|
}
|
|
virtual void notify(UIEventType t = UIEventType::none) = 0;
|
|
virtual void loop() = 0;
|
|
};
|