mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-12 01:53:07 +03:00
Add getCommand() api for OTA update type (#2259)
This commit is contained in:
@ -27,7 +27,14 @@ void setup() {
|
||||
// ArduinoOTA.setPassword((const char *)"123");
|
||||
|
||||
ArduinoOTA.onStart([]() {
|
||||
Serial.println("Start");
|
||||
String type;
|
||||
if (ArduinoOTA.getCommand() == U_FLASH)
|
||||
type = "sketch";
|
||||
else // U_SPIFFS
|
||||
type = "filesystem";
|
||||
|
||||
// NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end()
|
||||
Serial.println("Start updating " + type);
|
||||
});
|
||||
ArduinoOTA.onEnd([]() {
|
||||
Serial.println("\nEnd");
|
||||
|
Reference in New Issue
Block a user