File tree 2 files changed +14
-0
lines changed
2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -349,6 +349,18 @@ void ArduinoOTAClass::_runUpdate() {
349
349
}
350
350
}
351
351
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
+ }
352
364
// this needs to be called in the loop()
353
365
void ArduinoOTAClass::handle () {
354
366
if (_state == OTA_RUNUPDATE) {
Original file line number Diff line number Diff line change @@ -62,6 +62,8 @@ class ArduinoOTAClass
62
62
// Starts the ArduinoOTA service
63
63
void begin (bool useMDNS = true );
64
64
65
+ // Ends the ArduinoOTA service
66
+ void end ();
65
67
// Call this in loop() to run the service. Also calls MDNS.update() when begin() or begin(true) is used.
66
68
void handle ();
67
69
You can’t perform that action at this time.
0 commit comments