Parcourir la source

fix: libfota/libfota2在非fota请求时主动清除/update.bin

Wendal Chen il y a 1 an
Parent
commit
b6aaa58a57
2 fichiers modifiés avec 2 ajouts et 0 suppressions
  1. 1 0
      script/libs/libfota.lua
  2. 1 0
      script/libs/libfota2.lua

+ 1 - 0
script/libs/libfota.lua

@@ -90,6 +90,7 @@ local function fota_task(cbFnc,storge_location, len, param1,ota_url,ota_port,lib
     if fota then
         opts.fota = true
     else
+        os.remove("/update.bin")
         opts.dst = "/update.bin"
     end
     log.info("fota.url", ota_url)

+ 1 - 0
script/libs/libfota2.lua

@@ -101,6 +101,7 @@ function libfota2.request(cbFnc, opts)
     if fota then
         opts.fota = true
     else
+        os.remove("/update.bin")
         opts.dst = "/update.bin"
     end
     if not cbFnc then