2025-08-16 20:04:54 +10:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <MeshCore.h>
|
|
|
|
|
#include <helpers/ui/DisplayDriver.h>
|
|
|
|
|
#include <helpers/ui/UIScreen.h>
|
|
|
|
|
#include <helpers/SensorManager.h>
|
|
|
|
|
#include <helpers/BaseSerialInterface.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;
|
|
|
|
|
BaseSerialInterface* _serial;
|
|
|
|
|
bool _connected;
|
|
|
|
|
|
|
|
|
|
AbstractUITask(mesh::MainBoard* board, BaseSerialInterface* serial) : _board(board), _serial(serial) {
|
|
|
|
|
_connected = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
void setHasConnection(bool connected) { _connected = connected; }
|
|
|
|
|
bool hasConnection() const { return _connected; }
|
|
|
|
|
uint16_t getBattMilliVolts() const { return _board->getBattMilliVolts(); }
|
|
|
|
|
bool isSerialEnabled() const { return _serial->isEnabled(); }
|
|
|
|
|
void enableSerial() { _serial->enable(); }
|
|
|
|
|
void disableSerial() { _serial->disable(); }
|
|
|
|
|
virtual void msgRead(int msgcount) = 0;
|
2026-05-11 19:27:16 +02:00
|
|
|
virtual void newMsg(uint8_t path_len, const char* from_name, const char* text, int msgcount, uint8_t contact_type = 0) = 0;
|
2025-09-17 08:53:50 +08:00
|
|
|
virtual void notify(UIEventType t = UIEventType::none) = 0;
|
WioTrackerL1: redesign companion UI (channels, keyboard, msg preview)
- QuickMsg → Message screen: channel history, on-screen keyboard, custom message first
- Channel history: RAM ring buffer (32 entries, 80 chars), fullscreen view with word-wrap scroll
- After channel send: stay in history, own message shown as "Me: ..."
- MsgPreview: one message per screen with up/down nav, ENTER opens fullscreen scroll
- Monochromatic display: all color usage corrected to DARK/LIGHT only
- Top bar: battery icon, BT muted indicator, splash "Plus for Wio"
- KB_MAX_LEN: 64 → 100 chars; channel text buffer: 52 → 80 chars
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-11 15:56:30 +02:00
|
|
|
virtual void addChannelMsg(uint8_t channel_idx, const char* text) {}
|
2025-08-17 16:31:50 +10:00
|
|
|
virtual void loop() = 0;
|
2025-08-16 20:04:54 +10:00
|
|
|
};
|