#pragma once #include #include #include #include #include #include #ifdef PIN_BUZZER #include #endif #include "NodePrefs.h" #include "MyMesh.h" enum class UIEventType { none, contactMessage, channelMessage, roomMessage, newContactMessage, ack }; class AbstractUITask : public MyMesh::Listener { protected: mesh::MainBoard* _board; MultiSerialInterface* _interfaceManager; AbstractUITask(mesh::MainBoard* board, MultiSerialInterface* interfaceManager) : _board(board), _interfaceManager(interfaceManager) { } public: bool hasConnection() const { return _interfaceManager->isConnected(); } uint16_t getBattMilliVolts() const { return _board->getBattMilliVolts(); } bool isBluetoothEnabled() const { return _interfaceManager->isBluetoothEnabled(); } void enableBluetooth() { _interfaceManager->enableBluetooth(); } void disableBluetooth() { _interfaceManager->disableBluetooth(); } virtual void notify(UIEventType t = UIEventType::none) = 0; virtual void loop() = 0; };