Reduced UDP traffic on WiFi
This commit is contained in:
+6
-4
@@ -328,6 +328,7 @@ unsigned long rtplustickerhold;
|
|||||||
unsigned long rtticker;
|
unsigned long rtticker;
|
||||||
unsigned long rttickerhold;
|
unsigned long rttickerhold;
|
||||||
unsigned long tuningtimer;
|
unsigned long tuningtimer;
|
||||||
|
unsigned long udptimer;
|
||||||
|
|
||||||
TEF6686 radio;
|
TEF6686 radio;
|
||||||
TFT_eSprite sprite = TFT_eSprite(&tft);
|
TFT_eSprite sprite = TFT_eSprite(&tft);
|
||||||
@@ -2203,11 +2204,11 @@ void ShowFreq(int mode) {
|
|||||||
if (wifi) {
|
if (wifi) {
|
||||||
Udp.beginPacket(remoteip, 9030);
|
Udp.beginPacket(remoteip, 9030);
|
||||||
if (band == BAND_FM) {
|
if (band == BAND_FM) {
|
||||||
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10) + ";bandwidth=-1;freq=" + String(frequency) + "0000");
|
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency) + "0000");
|
||||||
} else if (band == BAND_OIRT) {
|
} else if (band == BAND_OIRT) {
|
||||||
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10) + ";bandwidth=-1;freq=" + String(frequency_OIRT) + "0000");
|
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency_OIRT) + "0000");
|
||||||
} else {
|
} else {
|
||||||
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10) + ";bandwidth=-1;freq=" + String(frequency_AM) + "000");
|
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";freq=" + String(frequency_AM) + "000");
|
||||||
}
|
}
|
||||||
Udp.endPacket();
|
Udp.endPacket();
|
||||||
}
|
}
|
||||||
@@ -2274,7 +2275,8 @@ void ShowSignalLevel() {
|
|||||||
SStatusold = SStatusprint;
|
SStatusold = SStatusprint;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (wifi) {
|
if (wifi && millis() >= udptimer + 2000) {
|
||||||
|
udptimer = millis();
|
||||||
Udp.beginPacket(remoteip, 9030);
|
Udp.beginPacket(remoteip, 9030);
|
||||||
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10));
|
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RcvLevel=" + String(SStatus / 10));
|
||||||
Udp.endPacket();
|
Udp.endPacket();
|
||||||
|
|||||||
+13
-11
@@ -287,11 +287,11 @@ void doAF() {
|
|||||||
Udp.print(String((radio.af[af_scan].frequency - 8750) / 10, HEX));
|
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");
|
for (int i = 0; i < 25 - radio.af_counter; i++) Udp.print("00");
|
||||||
Udp.endPacket();
|
Udp.endPacket();
|
||||||
}
|
}
|
||||||
|
af_counterold = radio.af_counter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -772,17 +772,19 @@ void showRadioText() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (wifi) {
|
if (wifi) {
|
||||||
Udp.beginPacket(remoteip, 9030);
|
if (RTold != (radio.rds.stationText + " " + radio.rds.stationText32)) {
|
||||||
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RT1=");
|
Udp.beginPacket(remoteip, 9030);
|
||||||
char RThex[65];
|
Udp.print("from=TEF_tuner " + String(stationlistid, DEC) + ";RT1=");
|
||||||
radio.rds.stationText.toCharArray(RThex, 65);
|
char RThex[65];
|
||||||
for (int i = 0; i < 64; i++)
|
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] = '_';
|
if (RThex[i] < 0x10) Udp.print("0");
|
||||||
Udp.print(String(RThex[i], HEX));
|
if (RThex[i] == ' ') RThex[i] = '_';
|
||||||
|
Udp.print(String(RThex[i], HEX));
|
||||||
|
}
|
||||||
|
Udp.endPacket();
|
||||||
}
|
}
|
||||||
Udp.endPacket();
|
|
||||||
}
|
}
|
||||||
RTold = radio.rds.stationText + " " + radio.rds.stationText32;
|
RTold = radio.rds.stationText + " " + radio.rds.stationText32;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user