重构OTA升级 159/2 159/head
authorhcj_ <1224667075@qq.com>
Fri, 10 May 2024 09:31:22 +0000 (17:31 +0800)
committerhcj_ <1224667075@qq.com>
Fri, 10 May 2024 09:31:22 +0000 (17:31 +0800)
code/sdk/application/wearable/fd230app/nativeui/systemupdate/src/SystemUpdateView.cpp
code/sdk/drivers/peripheral/utils/custom_utils.c

index ffc7975..0262dde 100644 (file)
@@ -31,7 +31,7 @@
 #include "cat1_ctl.h"
 #include "cat1_server_hal.h"
 
-#define OTA_UPDATA_TEST 1
+#define OTA_UPDATA_TEST 0
 
 namespace OHOS
 {
@@ -283,7 +283,7 @@ namespace OHOS
         uint32_t version_len=128;
         uapi_get_buildversion((uint8_t*)version_buf,version_len);
         #if OTA_UPDATA_TEST
-        sprintf((char *)uri,JSON_URL,"860132060413978","V1.1_20240508_211447");
+        sprintf((char *)uri,JSON_URL,"860132060413978","V1.1_20240507_185224");
         #else
         sprintf((char *)uri,JSON_URL,imei_str,version_buf);
         #endif
@@ -348,6 +348,23 @@ namespace OHOS
             delete TryAgainLaterButton;
             TryAgainLaterButton = nullptr;
 
+            delete updatasider;
+            updatasider = nullptr;
+
+             delete IMEIlabel;
+            IMEIlabel = nullptr;
+
+            delete CATlabel;
+            CATlabel = nullptr;
+
+
+            delete NEWMSGLabel;
+            NEWMSGLabel = nullptr;
+
+            delete NEWVersionIdLabel;
+            NEWVersionIdLabel = nullptr;
+
+
             delete SystemUpdateScrollView;
             SystemUpdateScrollView = nullptr;
 
@@ -386,7 +403,12 @@ namespace OHOS
             break;
         case OTA_BUTTON_GET_ABLE_UPDTAT:
             SystemUpdateModel ::GetInstance() .report_jsonString_write();
-            //uaip_cmd_update_request();
+            #if OTA_UPDATA_TEST
+            uapi_reboot_device();
+            #else
+            uaip_cmd_update_request();
+            #endif
+            
             break;
 
          default:
index 3de235e..842114f 100644 (file)
@@ -322,7 +322,7 @@ void startup_post_init_task(void)
     
     LOS_Msleep(5000);
     addressbookToRead(NULL);
-    // up_report_timer();
+    up_report_timer();
     if ( poweron_cat1_on_bootup_flag() )
     {
         PRINT("PowerOn Cat1 !\r\n");