diff --git a/src/main.cpp b/src/main.cpp index a754c63..ea51c1a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -227,13 +227,6 @@ class OtaCharacteristicCallbacks : public NimBLECharacteristicCallbacks { const uint8_t *data = (const uint8_t *)value.data(); size_t len = value.length(); - if (otaWaitingForReboot && len == 1 && data[0] == 0xFF) { - otaWaitingForReboot = false; - otaConfirmed = true; - Serial.println("OTA: reboot confirmation received"); - return; - } - if (len == 5 && data[0] == OTA_CMD_START) { if (otaInProgress) { esp_ota_end(otaHandle); @@ -489,26 +482,6 @@ void setup() { } void loop() { - if (otaWaitingForReboot) { - if (millis() - otaRebootWaitStart > 10000) { - Serial.println("OTA: no confirmation after 10s, rebooting anyway"); - otaWaitingForReboot = false; - otaConfirmed = true; - } - delay(10); - return; - } - if (otaConfirmed) { - otaConfirmed = false; - esp_err_t err = esp_ota_set_boot_partition(otaPartition); - if (err != ESP_OK) { - Serial.printf("OTA: set boot partition failed (%d)\n", err); - } - delay(100); - esp_restart(); - return; - } - if (!otaInProgress && Serial.available()) { static String serialBuf; char c = Serial.read();