mirror of
https://github.com/ratspeak/ratdeck.git
synced 2026-07-17 03:21:53 +00:00
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
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:
+7
-2
@@ -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
@@ -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;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user