Reduced UDP traffic on WiFi

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-09-06 16:54:07 +02:00
parent 7e3b9b72a7
commit bdbd851e29
2 changed files with 19 additions and 15 deletions
+13 -11
View File
@@ -287,11 +287,11 @@ void doAF() {
Udp.print(String((radio.af[af_scan].frequency - 8750) / 10, HEX));
}
}
af_counterold = radio.af_counter;
for (int i = 0; i < 25 - radio.af_counter; i++) Udp.print("00");
Udp.endPacket();
}
af_counterold = radio.af_counter;
}
}
@@ -772,17 +772,19 @@ void showRadioText() {
}
if (wifi) {
Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RT1=");
char RThex[65];
radio.rds.stationText.toCharArray(RThex, 65);
for (int i = 0; i < 64; i++)
{
if (RThex[i] < 0x10) Udp.print("0");
if (RThex[i] == ' ') RThex[i] = '_';
Udp.print(String(RThex[i], HEX));
if (RTold != (radio.rds.stationText + " " + radio.rds.stationText32)) {
Udp.beginPacket(remoteip, 9030);
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RT1=");
char RThex[65];
radio.rds.stationText.toCharArray(RThex, 65);
for (int i = 0; i < 64; i++)
{
if (RThex[i] < 0x10) Udp.print("0");
if (RThex[i] == ' ') RThex[i] = '_';
Udp.print(String(RThex[i], HEX));
}
Udp.endPacket();
}
Udp.endPacket();
}
RTold = radio.rds.stationText + " " + radio.rds.stationText32;
}