File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,18 @@ void ArduinoOTAClass::_runUpdate() {
349349 }
350350}
351351
352+ void ArduinoOTAClass::end () {
353+ _initialized = false ;
354+ _udp_ota->unref ();
355+ _udp_ota = 0 ;
356+ if (_useMDNS){
357+ MDNS.end ();
358+ }
359+ _state = OTA_IDLE;
360+ #ifdef OTA_DEBUG
361+ OTA_DEBUG.printf (" OTA server stopped.\n " );
362+ #endif
363+ }
352364// this needs to be called in the loop()
353365void ArduinoOTAClass::handle () {
354366 if (_state == OTA_RUNUPDATE) {
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ class ArduinoOTAClass
6262 // Starts the ArduinoOTA service
6363 void begin (bool useMDNS = true );
6464
65+ // Ends the ArduinoOTA service
66+ void end ();
6567 // Call this in loop() to run the service. Also calls MDNS.update() when begin() or begin(true) is used.
6668 void handle ();
6769
You can’t perform that action at this time.
0 commit comments