RDS USA mode: When callsign not found in database and calculator ends up with wrong chars, only show a ?

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-11-11 12:23:37 +01:00
parent 25920aa6ee
commit 5a0878e0e5

View File

@@ -540,6 +540,21 @@ void TEF6686::readRDS(byte showrdserrors)
rds.stationID[3] = char(((stationID - 676 * int(stationID / 676)) % 26) + 65); 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[7] = '?';
rds.stationID[8] = '\0'; rds.stationID[8] = '\0';
} }