From 5a0878e0e56b01e4ca8a0b5c2161e1aecdba1e2e Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Sat, 11 Nov 2023 12:23:37 +0100 Subject: [PATCH] RDS USA mode: When callsign not found in database and calculator ends up with wrong chars, only show a ? --- src/TEF6686.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/TEF6686.cpp b/src/TEF6686.cpp index 0af34ed..b62bf78 100644 --- a/src/TEF6686.cpp +++ b/src/TEF6686.cpp @@ -540,6 +540,21 @@ void TEF6686::readRDS(byte showrdserrors) rds.stationID[3] = char(((stationID - 676 * int(stationID / 676)) % 26) + 65); } } + + bool faultyID = false; + + for (byte i = 0; i < 4; i++) { + if (!(rds.stationID[i] >= 'A' && rds.stationID[i] <= 'Z')) { + faultyID = true; + break; + } + } + + if (faultyID) { + for (byte i = 0; i < 9; i++) { + rds.stationID[i] = ' '; + } + } rds.stationID[7] = '?'; rds.stationID[8] = '\0'; }