Fix for RDSSPY over TCP

This commit is contained in:
Sjef Verhoeven PE5PVB
2023-08-04 23:05:16 +02:00
parent 2ad43d12fb
commit 6b4f35b0a4
2 changed files with 16 additions and 23 deletions
+4 -9
View File
@@ -3636,10 +3636,8 @@ void Communication() {
} }
} }
if (Server.hasClient()) if (Server.hasClient()) {
{ if (RemoteClient.connected()) {
if (RemoteClient.connected())
{
Server.available().stop(); Server.available().stop();
} else { } else {
wificonnected = true; wificonnected = true;
@@ -3657,11 +3655,9 @@ void Communication() {
XDRGTKTCP = false; XDRGTKTCP = false;
} }
if (XDRGTKTCP == false && wificonnected == true && RemoteClient.available()) { if (XDRGTKTCP == false && wificonnected == true && RemoteClient.available()) {
String data_str = RemoteClient.readStringUntil('\n'); 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(); radio.setFMABandw();
if (band != BAND_FM) { if (band != BAND_FM) {
band = BAND_FM; band = BAND_FM;
@@ -3670,8 +3666,7 @@ void Communication() {
XDRGTKTCP = true; XDRGTKTCP = true;
RemoteClient.print("o1,0\n"); RemoteClient.print("o1,0\n");
store = true; 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; RDSSPYTCP = true;
} else if (RDSSPYTCP == true) { } else if (RDSSPYTCP == true) {
int symPos = data_str.indexOf("*F"); int symPos = data_str.indexOf("*F");
+12 -14
View File
@@ -137,19 +137,17 @@ void MenuUp();
void MenuDown(); void MenuDown();
void DoMenu(); void DoMenu();
// Extern: extern void ShowFreq(int mode);
//void tftPrint(int8_t offset, const String & text, int16_t x, int16_t y, int color, int smoothcolor, const uint8_t* font); extern void ShowBandSelectionFM(bool notglanceview, bool normaldisplay);
void ShowFreq(int mode); extern void ShowBandSelectionAM(bool notglanceview, bool normaldisplay);
void ShowBandSelectionFM(bool notglanceview, bool normaldisplay); extern void ScreensaverTimerSet(byte value);
void ShowBandSelectionAM(bool notglanceview, bool normaldisplay); extern void ShowMemoryPos();
void ScreensaverTimerSet(byte value); extern void ShowTuneMode();
void ShowMemoryPos(); extern void updateBW();
void ShowTuneMode(); extern void ShowStepSize();
void updateBW(); extern void updateiMS();
void ShowStepSize(); extern void updateEQ();
void updateiMS(); extern void doTheme();
void updateEQ(); extern void tryWiFi();
void doTheme();
void tryWiFi();
#endif #endif