From 42efbda40a8c7ef334b7745b661066e3f1baae69 Mon Sep 17 00:00:00 2001 From: hank Date: Sun, 1 Jun 2025 19:57:35 -0700 Subject: [PATCH] Re-applying ecd2b0b --- 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 db40169f..f4ee900b 100644 --- a/examples/companion_radio/MyMesh.cpp +++ b/examples/companion_radio/MyMesh.cpp @@ -545,7 +545,8 @@ void MyMesh::onChannelMessageRecv(const mesh::GroupChannel &channel, mesh::Packe out_frame[i++] = RESP_CODE_CHANNEL_MSG_RECV; } - out_frame[i++] = findChannelIdx(channel); + uint8_t channel_idx = findChannelIdx(channel); + out_frame[i++] = channel_idx; uint8_t path_len = out_frame[i++] = pkt->isRouteFlood() ? pkt->path_len : 0xFF; out_frame[i++] = TXT_TYPE_PLAIN; @@ -570,7 +571,13 @@ void MyMesh::onChannelMessageRecv(const mesh::GroupChannel &channel, mesh::Packe #endif } #ifdef DISPLAY_CLASS - ui_task.newMsg(path_len, "Public", text, offline_queue_len); + // Get the channel name from the channel index + const char *channel_name = "Unknown"; + ChannelDetails channel_details; + if (getChannel(channel_idx, channel_details)) { + channel_name = channel_details.name; + } + ui_task.newMsg(path_len, channel_name, text, offline_queue_len); #endif }