v1.6.2: Fix announce bin8 encoding in Settings, deduplicate encodeAnnounceName
PlatformIO Build / build (push) Failing after 30s
PlatformIO Build / release (push) Has been skipped

Apply bin8 fix to the duplicate announce encoding in LvSettingsScreen
(Send Announce action). Replace inline copy with shared function from
main.cpp. Follows up on PR #5.
This commit is contained in:
DeFiDude
2026-03-15 12:32:54 -06:00
parent e3dffe6df2
commit d89b6699ab
3 changed files with 9 additions and 11 deletions
+7 -2
View File
@@ -6,8 +6,8 @@
#define RATDECK_VERSION_MAJOR 1
#define RATDECK_VERSION_MINOR 6
#define RATDECK_VERSION_PATCH 1
#define RATDECK_VERSION_STRING "1.6.1"
#define RATDECK_VERSION_PATCH 2
#define RATDECK_VERSION_STRING "1.6.2"
// --- Feature Flags ---
#define HAS_DISPLAY true
@@ -63,3 +63,8 @@
// --- Serial Debug ---
#define SERIAL_BAUD 115200
// --- Shared Utilities (defined in main.cpp) ---
#include <Arduino.h>
#include <Bytes.h>
RNS::Bytes encodeAnnounceName(const String& name);
+1 -1
View File
@@ -130,7 +130,7 @@ unsigned long wifiConnectedAt = 0;
// Announce with display name (MessagePack-encoded app_data)
// =============================================================================
static RNS::Bytes encodeAnnounceName(const String& name) {
RNS::Bytes encodeAnnounceName(const String& name) {
if (name.isEmpty()) return {};
size_t len = name.length();
if (len > 31) len = 31;
+1 -8
View File
@@ -450,14 +450,7 @@ void LvSettingsScreen::buildItems() {
announceItem.formatter = [](int) { return String("[Enter]"); };
announceItem.action = [this]() {
if (_rns && _cfg) {
const String& name = _cfg->settings().displayName;
RNS::Bytes appData;
if (!name.isEmpty()) {
size_t len = name.length(); if (len > 31) len = 31;
uint8_t buf[2 + 31]; buf[0] = 0x91; buf[1] = 0xA0 | (uint8_t)len;
memcpy(buf + 2, name.c_str(), len);
appData = RNS::Bytes(buf, 2 + len);
}
RNS::Bytes appData = encodeAnnounceName(_cfg->settings().displayName);
_rns->announce(appData);
if (_ui) { _ui->lvStatusBar().flashAnnounce(); _ui->lvStatusBar().showToast("Announce sent!"); }
} else {