From 6b4f35b0a48d2db65428969d84962aea6605af2b Mon Sep 17 00:00:00 2001 From: Sjef Verhoeven PE5PVB Date: Fri, 4 Aug 2023 23:05:16 +0200 Subject: [PATCH] Fix for RDSSPY over TCP --- TEF6686_ESP32.ino | 13 ++++--------- src/gui.h | 26 ++++++++++++-------------- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/TEF6686_ESP32.ino b/TEF6686_ESP32.ino index 383da0a..5a899ef 100644 --- a/TEF6686_ESP32.ino +++ b/TEF6686_ESP32.ino @@ -3636,10 +3636,8 @@ void Communication() { } } - if (Server.hasClient()) - { - if (RemoteClient.connected()) - { + if (Server.hasClient()) { + if (RemoteClient.connected()) { Server.available().stop(); } else { wificonnected = true; @@ -3657,11 +3655,9 @@ void Communication() { XDRGTKTCP = false; } - if (XDRGTKTCP == false && wificonnected == true && RemoteClient.available()) { String data_str = RemoteClient.readStringUntil('\n'); - if (data_str.length() > 30 && data_str.equals(cryptedpassword)) - { + if (data_str.length() > 30 && data_str.equals(cryptedpassword)) { radio.setFMABandw(); if (band != BAND_FM) { band = BAND_FM; @@ -3670,8 +3666,7 @@ void Communication() { XDRGTKTCP = true; RemoteClient.print("o1,0\n"); store = true; - } else if (RDSSPYTCP == false && XDRGTKTCP == false && data_str.length() < 6 && data_str == ("*D*R?F")) - { + } else if (RDSSPYTCP == false && XDRGTKTCP == false && data_str.length() > 1 && data_str == ("*D*R?F")) { RDSSPYTCP = true; } else if (RDSSPYTCP == true) { int symPos = data_str.indexOf("*F"); diff --git a/src/gui.h b/src/gui.h index 1d1a453..4726c2a 100644 --- a/src/gui.h +++ b/src/gui.h @@ -137,19 +137,17 @@ void MenuUp(); void MenuDown(); void DoMenu(); -// Extern: -//void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, const uint8_t* font); -void ShowFreq(int mode); -void ShowBandSelectionFM(bool notglanceview, bool normaldisplay); -void ShowBandSelectionAM(bool notglanceview, bool normaldisplay); -void ScreensaverTimerSet(byte value); -void ShowMemoryPos(); -void ShowTuneMode(); -void updateBW(); -void ShowStepSize(); -void updateiMS(); -void updateEQ(); -void doTheme(); -void tryWiFi(); +extern void ShowFreq(int mode); +extern void ShowBandSelectionFM(bool notglanceview, bool normaldisplay); +extern void ShowBandSelectionAM(bool notglanceview, bool normaldisplay); +extern void ScreensaverTimerSet(byte value); +extern void ShowMemoryPos(); +extern void ShowTuneMode(); +extern void updateBW(); +extern void ShowStepSize(); +extern void updateiMS(); +extern void updateEQ(); +extern void doTheme(); +extern void tryWiFi(); #endif \ No newline at end of file