From 7ea6a9851362546ee181123b810935cc4d26dac6 Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sun, 6 Jul 2025 14:07:56 +1200 Subject: [PATCH 1/2] dont show cli data replies on display --- examples/companion_radio/MyMesh.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index 879200b75..c141f9d61 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -315,17 +315,24 @@ void MyMesh::queueMessage(const ContactInfo &from, uint8_t txt_type, mesh::Packe i += tlen; addToOfflineQueue(out_frame, i); + // we only want to show text messages on display, not cli data + bool should_display = txt_type == TXT_TYPE_PLAIN || txt_type == TXT_TYPE_SIGNED_PLAIN; + if (_serial->isConnected()) { uint8_t frame[1]; frame[0] = PUSH_CODE_MSG_WAITING; // send push 'tickle' _serial->writeFrame(frame, 1); } else { #ifdef DISPLAY_CLASS - ui_task.soundBuzzer(UIEventType::contactMessage); + if(should_display){ + ui_task.soundBuzzer(UIEventType::contactMessage); + } #endif } #ifdef DISPLAY_CLASS - ui_task.newMsg(path_len, from.name, text, offline_queue_len); + if(should_display){ + ui_task.newMsg(path_len, from.name, text, offline_queue_len); + } #endif } From 0914056a09244b850f43595d27303e9d5ecf500f Mon Sep 17 00:00:00 2001 From: liamcottle Date: Sun, 6 Jul 2025 14:16:43 +1200 Subject: [PATCH 2/2] tidy logic for devices with display --- examples/companion_radio/MyMesh.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/examples/companion_radio/MyMesh.cpp b/examples/companion_radio/MyMesh.cpp index c141f9d61..6ddc19d65 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -315,23 +315,20 @@ void MyMesh::queueMessage(const ContactInfo &from, uint8_t txt_type, mesh::Packe i += tlen; addToOfflineQueue(out_frame, i); - // we only want to show text messages on display, not cli data - bool should_display = txt_type == TXT_TYPE_PLAIN || txt_type == TXT_TYPE_SIGNED_PLAIN; - if (_serial->isConnected()) { uint8_t frame[1]; frame[0] = PUSH_CODE_MSG_WAITING; // send push 'tickle' _serial->writeFrame(frame, 1); - } else { -#ifdef DISPLAY_CLASS - if(should_display){ - ui_task.soundBuzzer(UIEventType::contactMessage); - } -#endif } + #ifdef DISPLAY_CLASS - if(should_display){ + // we only want to show text messages on display, not cli data + bool should_display = txt_type == TXT_TYPE_PLAIN || txt_type == TXT_TYPE_SIGNED_PLAIN; + if (should_display) { ui_task.newMsg(path_len, from.name, text, offline_queue_len); + if (!_serial->isConnected()) { + ui_task.soundBuzzer(UIEventType::contactMessage); + } } #endif }