mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-10-12 00:22:02 +00:00
refactor: port upstream MyMesh::Listener; MyMesh no longer calls the UI directly
Ports upstream's "Abstract UI overhaul" (PR #3431 + follow-ups) with identical names/signatures. MyMesh talks to the UI only through MyMesh::Listener (setListener()); a second block holds Solo extensions (own-send mirroring, relay echoes, room login/admin replies, [LOC] shares, contact/channel removal, bot device actions, requestShutdown), all no-op by default. AbstractUITask becomes the Listener and carries the glue MyMesh used to run for the UI (display filter, room-post labels, notifications, connection polling). BLE PIN randomisation moves to main.cpp as upstream. Also fixes ui-orig's stale advertReceived event on buzzer boards. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1843,7 +1843,7 @@ void UITask::handlePingResult(uint32_t tag, int16_t snr_out_x4, int16_t snr_back
|
||||
|
||||
// Static ping callback (for MyMesh)
|
||||
static void onPingResult(uint32_t tag, int16_t snr_out_x4, int16_t snr_back_x4, uint32_t rtt_ms) {
|
||||
AbstractUITask* ui = the_mesh.getUITask();
|
||||
MyMesh::Listener* ui = the_mesh.getListener();
|
||||
if (ui) {
|
||||
UITask* task = static_cast<UITask*>(ui);
|
||||
task->handlePingResult(tag, snr_out_x4, snr_back_x4, rtt_ms);
|
||||
@@ -2642,6 +2642,7 @@ void UITask::pollHallSensor() {
|
||||
}
|
||||
|
||||
void UITask::loop() {
|
||||
pollConnection(); // BLE link state -> hasConnection() (see AbstractUITask)
|
||||
// Background delivery: resend pending on-device DMs whose ACK timed out, and
|
||||
// finalise the ✗ marker — runs regardless of which screen is active.
|
||||
((MessagesScreen*)messages_screen)->tickDmResends();
|
||||
|
||||
Reference in New Issue
Block a user