Browse Source

fix: fota,file升级函数没有执行done和end

不过, 当前实现会阻塞整个lua线程, 不合适, 隐藏这个API吧

https://gitee.com/openLuat/LuatOS/issues/IDCEIQ
Wendal Chen 3 months ago
parent
commit
e01b98cb09
1 changed files with 12 additions and 0 deletions
  1. 12 0
      luat/modules/luat_lib_fota.c

+ 12 - 0
luat/modules/luat_lib_fota.c

@@ -221,6 +221,18 @@ static int l_fota_file(lua_State* L)
     luat_heap_free(buff);
     luat_heap_free(buff);
     luat_fs_fclose(fd);
     luat_fs_fclose(fd);
 
 
+    if (result == 0) {
+        LLOGI("fota file write done, call fota.done()");
+        result = luat_fota_done();
+        if (result == 0) {
+            LLOGI("fota done success, call fota.end()");
+            result = luat_fota_end(1);
+        }
+        else {
+            LLOGE("fota done fail %d", result);
+        }
+    }
+
     if (result > 0)
     if (result > 0)
     {
     {
     	lua_pushboolean(L, 1);
     	lua_pushboolean(L, 1);