From 218f5bdbf32e0ff599a55791b5fb39bd720f3f7c Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Fri, 30 May 2025 11:14:14 -0500 Subject: [PATCH 1/3] Move keyVerification messages to showOverlayBanner --- src/modules/KeyVerificationModule.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/modules/KeyVerificationModule.cpp b/src/modules/KeyVerificationModule.cpp index 062d79b0f..e0f415408 100644 --- a/src/modules/KeyVerificationModule.cpp +++ b/src/modules/KeyVerificationModule.cpp @@ -59,7 +59,7 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket & r->hash1.size == 0) { memcpy(hash2, r->hash2.bytes, 32); if (screen) - screen->startAlert("Enter Security Number"); // TODO: replace with actual prompt in BaseUI + screen->showOverlayBanner("Enter Security Number", 15000); meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; @@ -81,8 +81,7 @@ bool KeyVerificationModule::handleReceivedProtobuf(const meshtastic_MeshPacket & generateVerificationCode(message + 15); LOG_INFO("Hash1 matches!"); if (screen) { - screen->endAlert(); - screen->startAlert(message); + screen->showOverlayBanner(message, 15000); } meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; @@ -180,7 +179,7 @@ meshtastic_MeshPacket *KeyVerificationModule::allocReply() responsePacket->pki_encrypted = true; if (screen) { snprintf(message, 25, "Security Number \n%03u %03u", currentSecurityNumber / 1000, currentSecurityNumber % 1000); - screen->startAlert(message); + screen->showOverlayBanner(message, 15000); LOG_WARN("%s", message); } meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); @@ -250,8 +249,7 @@ void KeyVerificationModule::processSecurityNumber(uint32_t incomingNumber) sprintf(message, "Verification: \n"); generateVerificationCode(message + 15); // send the toPhone packet if (screen) { - screen->endAlert(); - screen->startAlert(message); + screen->showOverlayBanner(message, 15000); } meshtastic_ClientNotification *cn = clientNotificationPool.allocZeroed(); cn->level = meshtastic_LogRecord_Level_WARNING; @@ -287,8 +285,6 @@ void KeyVerificationModule::resetToIdle() currentSecurityNumber = 0; currentRemoteNode = 0; currentState = KEY_VERIFICATION_IDLE; - if (screen) - screen->endAlert(); } void KeyVerificationModule::generateVerificationCode(char *readableCode) From 3df894106bf9a31c2e36f2e6ac9817fd8b9e4664 Mon Sep 17 00:00:00 2001 From: Jason P Date: Fri, 30 May 2025 11:34:45 -0500 Subject: [PATCH 2/3] Update alignments and spacing (#6924) -Update alignment on node list -Adjust signal bar baseline --- src/graphics/Screen.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 9e38f46b1..9c018ad70 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -2420,7 +2420,7 @@ void drawEntryLastHeard(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawString(x + ((SCREEN_WIDTH > 128) ? 6 : 2), y, nodeName); + display->drawString(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nodeName); if (node->is_favorite) { if (SCREEN_WIDTH > 128) { drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); @@ -2444,8 +2444,8 @@ void drawEntryHopSignal(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int int nameMaxWidth = columnWidth - 25; int barsOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 16 : 20) // Offset for Wide Screens (Left Column:Right Column) : (isLeftCol ? 15 : 19); // Offset for Narrow Screens (Left Column:Right Column) - int hopOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 22 : 28) // Offset for Wide Screens (Left Column:Right Column) - : (isLeftCol ? 18 : 20); // Offset for Narrow Screens (Left Column:Right Column) + int hopOffset = (SCREEN_WIDTH > 128) ? (isLeftCol ? 17 : 25) // Offset for Wide Screens (Left Column:Right Column) + : (isLeftCol ? 13 : 17); // Offset for Narrow Screens (Left Column:Right Column) int barsXOffset = columnWidth - barsOffset; String nodeName = getSafeNodeName(node); @@ -2453,7 +2453,7 @@ void drawEntryHopSignal(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 2), y, nameMaxWidth, nodeName); + display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); if (node->is_favorite) { if (SCREEN_WIDTH > 128) { drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); @@ -2475,7 +2475,7 @@ void drawEntryHopSignal(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int int bars = (node->snr > 5) ? 4 : (node->snr > 0) ? 3 : (node->snr > -5) ? 2 : (node->snr > -10) ? 1 : 0; int barWidth = 2; int barStartX = x + barsXOffset; - int barStartY = y + (FONT_HEIGHT_SMALL / 2) + 2; + int barStartY = y + 1 + (FONT_HEIGHT_SMALL / 2) + 2; for (int b = 0; b < 4; b++) { if (b < bars) { @@ -2546,7 +2546,7 @@ void drawNodeDistance(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16 display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 2), y, nameMaxWidth, nodeName); + display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); if (node->is_favorite) { if (SCREEN_WIDTH > 128) { drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); @@ -2677,7 +2677,7 @@ void drawEntryCompass(OLEDDisplay *display, meshtastic_NodeInfoLite *node, int16 display->setTextAlignment(TEXT_ALIGN_LEFT); display->setFont(FONT_SMALL); - display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 2), y, nameMaxWidth, nodeName); + display->drawStringMaxWidth(x + ((SCREEN_WIDTH > 128) ? 6 : 3), y, nameMaxWidth, nodeName); if (node->is_favorite) { if (SCREEN_WIDTH > 128) { drawScaledXBitmap16x16(x, y + 6, smallbulletpoint_width, smallbulletpoint_height, smallbulletpoint, display); From 0edccf5b86e0742ec5e7595370154775609198e5 Mon Sep 17 00:00:00 2001 From: Jonathan Bennett Date: Sat, 31 May 2025 06:21:55 -0500 Subject: [PATCH 3/3] Do position broadcast on secondary channel if disabled on primary (#6920) * Do default position broadcast on secondary channel if disabled on primary * Consolidate the ifs * For Loops, how do they work? --- src/modules/PositionModule.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/modules/PositionModule.cpp b/src/modules/PositionModule.cpp index 0b1bdcc46..88bcdb016 100644 --- a/src/modules/PositionModule.cpp +++ b/src/modules/PositionModule.cpp @@ -328,7 +328,13 @@ void PositionModule::sendOurPosition() // If we changed channels, ask everyone else for their latest info LOG_INFO("Send pos@%x:6 to mesh (wantReplies=%d)", localPosition.timestamp, requestReplies); - sendOurPosition(NODENUM_BROADCAST, requestReplies); + for (uint8_t channelNum = 0; channelNum < 8; channelNum++) { + if (channels.getByIndex(channelNum).settings.has_module_settings && + channels.getByIndex(channelNum).settings.module_settings.position_precision != 0) { + sendOurPosition(NODENUM_BROADCAST, requestReplies, channelNum); + return; + } + } } void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t channel) @@ -340,11 +346,6 @@ void PositionModule::sendOurPosition(NodeNum dest, bool wantReplies, uint8_t cha // Set's the class precision value for this particular packet if (channels.getByIndex(channel).settings.has_module_settings) { precision = channels.getByIndex(channel).settings.module_settings.position_precision; - } else if (channels.getByIndex(channel).role == meshtastic_Channel_Role_PRIMARY) { - // backwards compatibility for Primary channels created before position_precision was set by default - precision = 13; - } else { - precision = 0; } meshtastic_MeshPacket *p = allocPositionPacket();