fix(server): add serial mute during ID? response
This commit is contained in:
parent
99fd6b21d4
commit
ae5028503f
1 changed files with 16 additions and 0 deletions
16
src/main.cpp
16
src/main.cpp
|
|
@ -16,6 +16,18 @@
|
||||||
|
|
||||||
static const char *TAG = "server";
|
static const char *TAG = "server";
|
||||||
|
|
||||||
|
static bool serialMuted = false;
|
||||||
|
|
||||||
|
static void muteSerial() {
|
||||||
|
serialMuted = true;
|
||||||
|
esp_log_level_set("*", ESP_LOG_NONE);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void unmuteSerial() {
|
||||||
|
serialMuted = false;
|
||||||
|
esp_log_level_set("*", CONFIG_LOG_DEFAULT_LEVEL);
|
||||||
|
}
|
||||||
|
|
||||||
#define RELAY1_PIN 1
|
#define RELAY1_PIN 1
|
||||||
#define RELAY2_PIN 2
|
#define RELAY2_PIN 2
|
||||||
#define TOUCH1_PIN 8
|
#define TOUCH1_PIN 8
|
||||||
|
|
@ -589,7 +601,11 @@ void loop() {
|
||||||
Serial.println("NO_KEY");
|
Serial.println("NO_KEY");
|
||||||
}
|
}
|
||||||
} else if (serialBuf == "ID?") {
|
} else if (serialBuf == "ID?") {
|
||||||
|
Serial.flush();
|
||||||
|
muteSerial();
|
||||||
Serial.println("SylDa_Server");
|
Serial.println("SylDa_Server");
|
||||||
|
delay(50);
|
||||||
|
unmuteSerial();
|
||||||
} else if (serialBuf == "VERSION?") {
|
} else if (serialBuf == "VERSION?") {
|
||||||
Serial.flush();
|
Serial.flush();
|
||||||
Serial.print("BUILD_NR:");
|
Serial.print("BUILD_NR:");
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue