网络下载升级
authorhcj <1224667075@qq.com>
Thu, 21 Mar 2024 09:37:15 +0000 (17:37 +0800)
committerhcj <1224667075@qq.com>
Thu, 21 Mar 2024 09:37:15 +0000 (17:37 +0800)
12 files changed:
code/sdk/application/wearable/fd230app/nativeui/config/include/ConfigModel.h
code/sdk/application/wearable/fd230app/nativeui/config/src/ConfigModel.cpp
code/sdk/application/wearable/fd230app/nativeui/phone/include/PhoneCallView.h
code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/phone/src/PhoneCallView.cpp
code/sdk/application/wearable/fd230app/nativeui/system/include/SystemPresenter.h
code/sdk/application/wearable/fd230app/nativeui/system/include/Systemupgrade.h
code/sdk/application/wearable/fd230app/nativeui/system/src/SystemPresenter.cpp
code/sdk/application/wearable/fd230app/nativeui/system/src/Systemupgrade.cpp
code/sdk/application/wearable/service/msg_center/CMakeLists.txt
code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp

index 4d96adf..8cde889 100644 (file)
@@ -34,6 +34,8 @@ namespace OHOS
         int GetHeartRateOrBloodOxygenQuickAccessSwitch(void);
         void SetDialId(uint8_t id);
         int GetDialId();
+        char * Getimei();
+        void Setimei(char *str);
         /* -------------------------------------------------------------------------- */
     private:
         ConfigModel();                                        // 私有构造函数,确保无法在外部实例化
@@ -51,6 +53,7 @@ namespace OHOS
         bool TradionalBlueToothToggleButtonState{false};     // 用来记录蓝牙开关状态,默认关闭状态
         int HeartRateOrBloodOxygenQuickAccessSwitch{0};      // 心率或血氧快速访问开关,默认快速访问血氧打开
         int dialid;
+        char * imei_str=NULL;
         /* -------------------------------------------------------------------------- */
     };
 
index 4bba51e..51690d4 100644 (file)
@@ -141,6 +141,28 @@ namespace OHOS
         return dialid;
     }
 
+    char* ConfigModel::Getimei()
+    {
+       
+        return imei_str;
+    }
+
+    void ConfigModel::Setimei(char *str)
+    {
+       if(imei_str==NULL || strcmp(imei_str,str)!=0)
+       {
+            if(imei_str==NULL)
+            {
+                imei_str=(char*)malloc(strlen(str));
+                strcpy(imei_str,str);
+            }
+            else
+            {
+                strcpy(imei_str,str);
+            }
+       }
+        return ;
+    }
     /* ------------------------------ ImageAnimator ----------------------------- */
 
     ImageAnimator::ImageAnimator()
index e56056e..80dc724 100644 (file)
@@ -70,9 +70,10 @@ namespace OHOS
         void ReLabel();\r
         void Init();\r
         void DeInit();\r
-\r
+        void container_child_init();\r
         void initButton(const ButtonInitParams &params);\r
         void UpdateLabel(const std::string &text);\r
+        void container_child_SetVisible(bool);\r
         UIView *GetView();\r
 \r
     private:\r
@@ -80,7 +81,10 @@ namespace OHOS
         PhoneCallView(PhoneCallView &&) = delete;\r
         PhoneCallView &operator=(PhoneCallView &&) = delete;\r
         UIViewGroup *container_ = nullptr;\r
+        UIViewGroup *container_child = nullptr;\r
         UILabel *label_ = nullptr;\r
+        UILabel *label_4G = nullptr;\r
+        UILabel *label_BT = nullptr;\r
         UIButton *button1_ = nullptr;\r
         UIButton *button2_ = nullptr;\r
         UIButton *button3_ = nullptr;\r
@@ -93,6 +97,9 @@ namespace OHOS
         UIButton *button0_ = nullptr;\r
         UIButton *buttoncall_ = nullptr;\r
         UIButton *buttondel_ = nullptr;\r
+        UIButton  *button_4G =NULL;\r
+        UIButton  *button_BT =NULL;\r
+        \r
     };\r
 } // namespace OHOS\r
 #endif\r
index 212cfc9..0987a0b 100644 (file)
@@ -4,6 +4,8 @@
 #include "phone/include/PhoneCallPresenter.h"\r
 #include <iostream>\r
 #include "cat1_server_hal.h"\r
+#include "PhoneService.h"\r
+#include "phone/include/PhoneCallView.h"\r
 namespace OHOS\r
 {\r
 \r
@@ -56,13 +58,27 @@ namespace OHOS
         if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&\r
             (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY()))))\r
         {\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_PHONE);\r
+            if(strcmp( view.GetViewId(), "button_4G_and_BT") == 0)\r
+            {\r
+                PhoneCallView::GetInstance()->container_child_SetVisible(false);\r
+                return true;\r
+            }\r
+           \r
         }\r
-        if ((event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP) &&\r
-            (event.GetStartPoint().y > 300))\r
+        if (event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT &&\r
+            (event.GetDeltaX() > 20) && (event.GetDeltaX() > (2 * MATH_ABS(event.GetDeltaY()))))\r
         {\r
-            NativeAbility::GetInstance().ChangeSlice(VIEW_PHONECALLING);\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_PHONE);\r
         }\r
+\r
+      \r
+\r
+\r
+        // if ((event.GetDragDirection() == DragEvent::DIRECTION_BOTTOM_TO_TOP) &&\r
+        //     (event.GetStartPoint().y > 300))\r
+        // {\r
+        //     NativeAbility::GetInstance().ChangeSlice(VIEW_PHONECALLING);\r
+        // }\r
         UNUSED(view);\r
         return true;\r
     }\r
@@ -71,12 +87,24 @@ namespace OHOS
         // 获取控件id\r
         const char *viewId = view.GetViewId();\r
 \r
+        if (strcmp(viewId, "button_4G") == 0)\r
+        {\r
+            // 拨号键\r
+            //NativeAbility::GetInstance().ChangeSlice(VIEW_PHONERING);\r
+            calldial_event_sendmsg_toUI((char *)phoneNumber.c_str());\r
+        }\r
+        else if (strcmp(viewId, "button_BT") == 0)\r
+        {\r
+    \r
+            DialCall((unsigned char *)phoneNumber.c_str(),phoneNumber.length());\r
+        }\r
         // 根据控件id处理点击事件\r
         if (strcmp(viewId, BUTTONCALL) == 0)\r
         {\r
             // 拨号键\r
             //NativeAbility::GetInstance().ChangeSlice(VIEW_PHONERING);\r
-            calldial_event_sendmsg_toUI((char *)phoneNumber.c_str());\r
+            //calldial_event_sendmsg_toUI((char *)phoneNumber.c_str());\r
+            PhoneCallView::GetInstance()->container_child_SetVisible(true);\r
         }\r
         else if (strcmp(viewId, BUTTONDEL) == 0)\r
         {\r
index 1873f5e..7447602 100644 (file)
@@ -62,6 +62,108 @@ namespace OHOS
         // Add to rootView\r
         container_->Add(button);\r
         button->SetVisible(true);\r
+\r
+        \r
+    }\r
+\r
+    void PhoneCallView ::container_child_init()\r
+    {\r
+        if (container_child == nullptr)\r
+        {\r
+            container_child = new UIViewGroup();\r
+            container_child->SetPosition(0, 0, 466, 466);\r
+            //container_child->SetStyle(STYLE_BACKGROUND_OPA, 0);\r
+        }\r
+        container_child->SetViewId("button_4G_and_BT");\r
+        //button_4G = params.button;\r
+        if (button_4G == nullptr)\r
+        {\r
+            button_4G = new UIButton();\r
+        }\r
+        button_4G->SetPosition(73, 144);\r
+        button_4G->Resize(140, 188);\r
+        button_4G->SetViewId("button_4G");\r
+        button_4G->SetStyle(STYLE_BACKGROUND_COLOR, 0xff14ff00);\r
+        button_4G->SetStyle(STYLE_BORDER_RADIUS, 50);\r
+        // Set additional properties\r
+        //button->SetImageSrc(defaultImgSrc, triggeredImgSrc);\r
+        button_4G->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+        button_4G->SetStyleForState(STYLE_BORDER_RADIUS,50,UIButton::PRESSED);\r
+        // Add the callback for events\r
+        UIView::OnClickListener *buttonClick = static_cast<UIView::OnClickListener *>(PhoneCallPresenter::GetInstance());\r
+        button_4G->SetOnClickListener(buttonClick);\r
+\r
+        // Add to rootView\r
+        container_child->Add(button_4G);\r
+\r
+        if (button_BT == nullptr)\r
+        {\r
+            button_BT = new UIButton();\r
+        }\r
+\r
+        button_BT->SetPosition(263, 144);\r
+        button_BT->Resize(140, 188);\r
+        button_BT->SetViewId("button_BT");\r
+        button_BT->SetStyle(STYLE_BACKGROUND_COLOR, 0xff0092ff);\r
+        button_BT->SetStyle(STYLE_BORDER_RADIUS, 50);\r
+        // Set additional properties\r
+        //button->SetImageSrc(defaultImgSrc, triggeredImgSrc);\r
+        button_BT->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);\r
+        button_BT->SetStyleForState(STYLE_BORDER_RADIUS,50,UIButton::PRESSED);\r
+        // Add the callback for events\r
+        //UIView::OnClickListener *buttonClick = static_cast<UIView::OnClickListener *>(PhoneCallPresenter::GetInstance());\r
+        button_BT->SetOnClickListener(buttonClick);\r
+\r
+        // Add to rootView\r
+        container_child->Add(button_BT);\r
+\r
+           if (label_4G == nullptr)\r
+        {\r
+            label_4G = new UILabel();\r
+        }\r
+        label_4G->SetPosition(112, 211); // widget's left position and top position\r
+        label_4G->Resize(236, 47);      // widget's width and height\r
+        label_4G->SetViewId("label1");  // Set style\r
+        label_4G->SetStyle(STYLE_TEXT_FONT, 40);\r
+\r
+        // Set additional property\r
+\r
+        label_4G->SetText("4G");\r
+        //printf("view phoneNumber: %s\n", PhoneCallPresenter::GetInstance()->phoneNumber.c_str());\r
+        label_4G->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);\r
+        label_4G->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
+        label_4G->SetRollSpeed(0);\r
+        label_4G->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40);\r
+        container_child->Add(label_4G);\r
+\r
+        if (label_BT == nullptr)\r
+        {\r
+            label_BT = new UILabel();\r
+        }\r
+        label_BT->SetPosition(302, 211); // widget's left position and top position\r
+        label_BT->Resize(236, 47);      // widget's width and height\r
+        label_BT->SetViewId("label2");  // Set style\r
+        label_BT->SetStyle(STYLE_TEXT_FONT, 40);\r
+\r
+        // Set additional property\r
+\r
+        label_BT->SetText("BT");\r
+        //printf("view phoneNumber: %s\n", PhoneCallPresenter::GetInstance()->phoneNumber.c_str());\r
+        label_BT->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);\r
+        label_BT->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);\r
+        label_BT->SetRollSpeed(0);\r
+        label_BT->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 40);\r
+        container_child->Add(label_BT);\r
+\r
+\r
+        container_child->SetVisible(false);\r
+\r
+\r
+    }\r
+\r
+    void PhoneCallView::container_child_SetVisible(bool falg)\r
+    {\r
+        container_child->SetVisible(falg);\r
     }\r
 \r
     void PhoneCallView::Init()\r
@@ -113,6 +215,8 @@ namespace OHOS
         {\r
             initButton(params);\r
         }\r
+        container_child_init();\r
+        container_->Add(container_child);\r
     }\r
     void PhoneCallView::ReLabel()\r
     {\r
@@ -121,10 +225,35 @@ namespace OHOS
     void PhoneCallView::DeInit()\r
     {\r
         printf("DeInit is ok !\n");\r
+\r
         if (container_ != nullptr)\r
         {\r
             container_->RemoveAll();\r
         }\r
+        if(container_child!=NULL)\r
+        {\r
+            container_->RemoveAll();\r
+        }\r
+        if(button_4G!=NULL)\r
+        {\r
+            delete button_4G;\r
+            button_4G = nullptr;\r
+        }\r
+        if(button_BT!=NULL)\r
+        {\r
+            delete button_BT;\r
+            button_BT = nullptr;\r
+        }\r
+        if(label_4G!=NULL)\r
+        {\r
+            delete label_4G;\r
+            label_4G = nullptr;\r
+        }\r
+        if(label_BT!=NULL)\r
+        {\r
+            delete label_BT;\r
+            label_BT = nullptr;\r
+        }\r
         if (button1_ != nullptr)\r
         {\r
             delete button1_;\r
index f588801..a92a604 100644 (file)
@@ -18,6 +18,7 @@ namespace OHOS
         SYSTEMLANGUAGEVIEW, // 系统语言视图(subView)\r
         FACTORYRESETVIEW,   // 恢复出厂设置视图(subView)upgrade\r
         SYSTEMLUPGRADE,\r
+        TEST,\r
         MAX_SYSTEMVIEWID,\r
     } SYSTEMVIEWID;\r
 \r
@@ -70,7 +71,7 @@ namespace OHOS
         void OnStop() override;\r
 \r
         static SystemPresenter *GetInstance();\r
-\r
+        void set_key_falg(bool);\r
     private:\r
         // 因为继承了OnClickListener,所以有OnClick属性,至于参数,原函数也这样直接继承;\r
         bool OnClick(UIView &view, const ClickEvent &event) override;\r
index a3aae39..bba3ef1 100644 (file)
@@ -9,6 +9,7 @@
 #include "components/ui_scroll_view.h"
 #include "components/ui_label.h"
 #include "components/ui_label_button_ext.h"
+#include "cat1_ctl.h"
 
 namespace OHOS
 {
@@ -22,7 +23,7 @@ namespace OHOS
 
         UIScrollView *SystemupgradeViewInit(void);
         void ClearAll(void);
-
+        void set_string_value(char *str,bool);
         struct LabelConfig
         {
             int16_t left;
@@ -36,19 +37,36 @@ namespace OHOS
         };
         UILabel *InitLabel(LabelConfig &labelConfig);
 
-    private:
-        UIScrollView *scrollView{nullptr};
-        UIImageView *FactoryResetImage{nullptr};       // 恢复出厂设置背景图片
-        UIButton *FactoryResetButtonCheckOn{nullptr};  // 重置确认
-        UIButton *FactoryResetButtonCheckOff{nullptr}; // 重置否定
+        UILabel *newVersionTitle{nullptr}; //  "最新软件版本"
+        UILabel *newVersion{nullptr};
 
-        UILabel *systemupgrade{nullptr}; //  "固件版本"
+        void detection_update(void);
+
+        void statr_down_fwpkg(void);
+
+        void statr_upgrade(void);
 
         UILabel *FirmwareVersionTitle{nullptr}; //  "固件版本"
         UILabel *FirmwareVersion{nullptr};
+        UILabel *new_label{nullptr};
+        void init_fail(uint8_t);
+    private:
+        UIScrollView *scrollView{nullptr};
+        //UIImageView *FactoryResetImage{nullptr};       // 恢复出厂设置背景图片
+        //UIButton *FactoryResetButtonCheckOn{nullptr};  // 重置确认
+       // UIButton *FactoryResetButtonCheckOff{nullptr}; // 重置否定
+        UILabelButtonExt * SystemUpgradeButton_;
+        UILabel *systemupgrade{nullptr}; //  "固件版本"
+        UILabel  *label_updating{nullptr}; 
+        UILabel  *label1_fail{nullptr};
+        UIViewGroup *container_updating{nullptr}; 
+        UIViewGroup *container_fail{nullptr}; 
+        UILabelButtonExt *labelButton1_exit=NULL;
+        void init_updating(); 
+        
+        bool is_new_version=false;
 
-        UILabel *newVersionTitle{nullptr}; //  "最新软件版本"
-        UILabel *newVersion{nullptr};
+        bool is_fwpkg_ready=false;
         
 
         bool initViewStatus{false};
index beb1bc7..010117f 100644 (file)
@@ -28,7 +28,8 @@ namespace OHOS
         {SUPERVISEVIEW,"SuperviseButton",true},\r
         {SYSTEMLANGUAGEVIEW,"SystemLanguageButton",false},\r
         {FACTORYRESETVIEW,"FactoryResetButton",true},\r
-        {SYSTEMLUPGRADE,"systemupgread",true}};\r
+        {SYSTEMLUPGRADE,"systemupgread",true},\r
+        //{TEST,"testButton",true}};\r
         \r
         // {ABOUTTHEWATCHVIEW, &SystemView::ChangeSystemAboutView},\r
         // {SUPERVISEVIEW, &SystemView::ChangeSystemSuperviseView},\r
@@ -115,6 +116,12 @@ namespace OHOS
         {\r
             if(strcmp(view.GetViewId(),ViewMapper_t[i].viewid_str) == 0)\r
             {\r
+                if(i==5)\r
+                {\r
+                    NativeAbility::GetInstance().ChangeSlice(VIEW_TEST);\r
+                    break;\r
+                }\r
+                \r
                 if(ViewMapper_t[i].enable_falg==true)\r
                 SystemView::GetInstance()->ChangeView(SYSTEMVIEW, ViewMapper_t[i].viewId);\r
                 return true;\r
@@ -132,11 +139,18 @@ namespace OHOS
             p_SystemView->ChangeView(FACTORYRESETVIEW, SYSTEMVIEW);\r
             return true;\r
         }\r
-        else if (strcmp(view.GetViewId(), SYSTEM_UPGRADE) == 0)\r
+       \r
+\r
+        if(strcmp(view.GetViewId(), SYSTEM_UPGRADE) == 0)\r
         {\r
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uaip_cmd_update_request");\r
-            uaip_cmd_update_request();\r
-            return true;\r
+            isSystemUpgradeState=true;\r
+            SystemupgradeView::GetInstance()->statr_down_fwpkg();\r
+        }\r
+        if(strcmp(view.GetViewId(),"labelButton1_exit")==0)\r
+        {\r
+           // SystemView::GetInstance()->ChangeSlice(VIEW_SETTING);;\r
+            NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING);\r
+            isSystemUpgradeState=false;\r
         }\r
         return false;\r
     }\r
@@ -151,6 +165,7 @@ namespace OHOS
     {\r
         if ((event.GetDragDirection() == DragEvent::DIRECTION_LEFT_TO_RIGHT))\r
         {\r
+            SystemPresenter:: GetInstance()->set_key_falg(false);\r
             NativeAbility::GetInstance().ChangeSlice(VIEW_SETTING);\r
         }\r
         return true;\r
@@ -241,4 +256,9 @@ namespace OHOS
         }\r
         return true;\r
     }\r
+\r
+    void SystemPresenter::set_key_falg(bool falg) // 增加按键事件\r
+    {\r
+       isSystemUpgradeState=falg;\r
+    }\r
 }
\ No newline at end of file
index 2079ddf..736640d 100644 (file)
 #include "wearable_log.h"
 #include "UiConfig.h"
 #include "custom_utils.h"
+#include "stdio.h"
+#include <iostream>
+#include <fstream>
+#include "cJSON.h"
+#include "config/include/ConfigModel.h"
+#include "lwip/err.h"
+#include "power_display_service.h"
+#include "cmsis_os2.h"
+#include "los_memory.h"
+#include "thread_init.h"
+ #include "lwip/apps/http_client.h"
+ #include "tcxo.h"
 namespace OHOS
 {
 
     static SystemupgradeView *g_pSystemFactoryResetView{nullptr};
+    static osThreadId_t g_alipay_task_handle = NULL;
+    //static char * imei_str="864430010001091";
+//     osThreadAttr_t g_alipay_attr = {
+//     "alipay_task", 0, NULL, 0, NULL, ALIPAT_MSG_STACK_SIZE, TASK_PRIORITY_ALIPAY_APP, 0, 0
+// };
+    static char *Path= "/user/data/ota_start_3.json";
+    static httpc_connection_t settings = {0};
+    static uint8_t uri[256] ={0};// (uint8_t*)
+    //"http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=V1.1_20240316_115535&imei=864430010001091";
+
+    static char *Path_ota_package= "/user/update.fwpkg";
+    static uint8_t uri_ota_package[124] ={0};
+    #define UP_TEST
+    static void upgrade_task(void  *arg)
+    {
+     
+        uapi_tcxo_delay_ms(3000);
+        char buf[1024]={0};
+        FILE * fp = fopen(Path,"rb");
+        if(fp==NULL)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "open fail");
+            SystemupgradeView::GetInstance()->set_string_value(NULL,false);
+            return;
+        }
+        int ret =fread(buf,1,1024,fp);
+        if(ret==0)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "fread %d",ret);
+            fclose(fp);
+            SystemupgradeView::GetInstance()->set_string_value(NULL,false);
+            return;
+        }
+       
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "httpc_download_result_ui %d",ret);
+        // std::string jsonDataString((std::istreambuf_iterator<char>(inFile)), std::istreambuf_iterator<char>());
+        // const char *jsonData = jsonDataString.c_str();
+        cJSON *root = cJSON_Parse(buf);
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "httpc_download_result_ui");
+        if(root!=NULL)
+        {
+            bool falg=cJSON_GetObjectItem(root, "UptoDate")->valueint;
+            char *uri = cJSON_GetObjectItem(root, "url")->valuestring;
+            sprintf((char *)uri_ota_package,"%s",uri);
+            char *OtaPackageVersion = cJSON_GetObjectItem(root, "OtaPackageVersion")->valuestring;
+            char *description = cJSON_GetObjectItem(root, "description")->valuestring;
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s,%s",uri,OtaPackageVersion);
+        //SystemupgradeView::GetInstance()->newVersion->SetText(OtaPackageVersion);
+            cJSON_Delete(root);
+            char buf[1024]={0};
+            sprintf(buf,"%s\n\n%s",OtaPackageVersion,description);
+            #ifdef UP_TEST
+                SystemupgradeView::GetInstance()->set_string_value(buf,true);
+            #else
+            if(falg)
+            {
+                SystemupgradeView::GetInstance()->set_string_value(buf,true);
+            }
+            else
+            {
+                SystemupgradeView::GetInstance()->set_string_value(NULL,false);
+            }
+            #endif
+        //RootView::GetInstance()->Invalidate();
+             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "httpc_download_result_ui");
+
+        }
+        fclose(fp);
+
+    }
+
+    static void upgrade_task_fwpkg(void  *arg)
+    {
+     
+        uapi_tcxo_delay_ms(3000);
+        FILE * fp = fopen(Path_ota_package,"rb");
+        if(fp!=NULL)
+        {
+            fclose(fp);
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "file open success fwpkg_is_ready");
+        }
+        errcode_t ret=uaip_cmd_update_request();
+        if(ret!=ERRCODE_SUCC)
+        {
+            SystemupgradeView::GetInstance()->init_fail(0);
+
+        }
+
+            //开始升级
+            //**********
+
+    }
+
+    // void create_ppg_queue(void)
+    // {
+    // if (osal_msg_queue_create("ppg_service_queue", 10, &g_app_queue,
+    //                           0, sizeof(PPG_CMD_TYPE_T)) != ERRCODE_SUCC) {
+    //     PRINT_ERR("[ppg][service] app create mail fail\n");
+    // }
+    // }
+
+    errcode_t upgrade_service_service_init(void)
+    {
+   
+        PRINT("uapi_ppg_service_init !\r\n");
+        app_task_definition_t taskcfg={0};
+        taskcfg.create_queue_handle = NULL;
+        taskcfg.attr.name="upgrade_service";
+        taskcfg.attr.priority = TASK_PRIORITY_APP;
+        taskcfg.attr.stack_size =  1024*8;
+        taskcfg.func = upgrade_task;
+        taskcfg.use_mem = USE_EXTEND_MEM;
+        
+        errcode_t ret=uapi_create_osThread_custom(&taskcfg);
+        if(ret != ERRCODE_SUCC)
+        {
+            PRINT("create ppg_service failed %d!\r\n",ret);
+            return ERRCODE_FAIL;
+        }
+
+        return ERRCODE_SUCC;
+    }
+
+     errcode_t upgrade_service_service_init_packpage(void)
+    {
+   
+        PRINT("uapi_ppg_service_init !\r\n");
+        app_task_definition_t taskcfg={0};
+        taskcfg.create_queue_handle = NULL;
+        taskcfg.attr.name="upgrade_service_ota_fwpkg";
+        taskcfg.attr.priority = TASK_PRIORITY_APP;
+        taskcfg.attr.stack_size =  1024*8;
+        taskcfg.func = upgrade_task_fwpkg;
+        taskcfg.use_mem = USE_EXTEND_MEM;
+        
+        errcode_t ret=uapi_create_osThread_custom(&taskcfg);
+        if(ret != ERRCODE_SUCC)
+        {
+            PRINT("create ppg_service failed %d!\r\n",ret);
+            return ERRCODE_FAIL;
+        }
+
+        return ERRCODE_SUCC;
+    }
+
+
+
+
+    static void httpc_download_result_ui_packpage(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "httpc_download_result_ui");
+        PRINT("httpc_download_result , httpc_result_t %d, rx_content_len %d , srv_res %d, err %d\n",
+            httpc_result,rx_content_len,srv_res,err);
+        uapi_cat1_wakeup_cat1(0);
+        if(httpc_result!=0)
+        {
+            SystemupgradeView::GetInstance()->init_fail(1);
+            return;
+        }
+        
+        
+        upgrade_service_service_init_packpage();//线程当timer用
+        return ;
+    }
+
+
+    static void httpc_download_result_ui(void *arg, httpc_result_t httpc_result, u32_t rx_content_len, u32_t srv_res, err_t err)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "httpc_download_result_ui");
+        PRINT("httpc_download_result , httpc_result_t %d, rx_content_len %d , srv_res %d, err %d\n",
+            httpc_result,rx_content_len,srv_res,err);
+        uapi_cat1_wakeup_cat1(0);
+        upgrade_service_service_init();//线程当timer用
+       
+        return ;
+    }
+
+    //static osTimerId_t  upgrade_timer=NULL;
+    static err_t httpc_download_headers_done_ui(httpc_state_t *connection, void *arg, struct pbuf *hdr, u16_t hdr_len, u32_t content_len)
+    {
+        WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "httpc_download_headers_done_ui");
+        return 0;
+    }
+
+    
+
+    static uint32_t custom_start_ota_download_ui_1( uint8_t *uri_str,uint8_t *Path,bool falg)
+    {
+    
+       //(uint8_t*)argv[0];
+        uint8_t *otadatapath = (uint8_t*)Path;
+        PRINT("custom_start_ota_download %s to %s\r\n",uri_str,otadatapath);
+        
+         uapi_cat1_wakeup_cat1(1);
+        if(falg)
+        {
+            settings.result_fn=httpc_download_result_ui;
+        }
+        else
+        {
+            settings.result_fn=httpc_download_result_ui_packpage;
+        }
+        
+        settings.headers_done_fn=httpc_download_headers_done_ui;
+        httpc_state_t* connection=NULL;
+        err_t rett =  httpc_get_file_dns_to_disk(
+                        (const char*) "icfota.snicker.com.cn", 
+                        8089,
+                        (const char*) uri_str,
+                        (const httpc_connection_t *)&settings,
+                        NULL, 
+                        (const char*) otadatapath, 
+                        &connection);
+
+        PRINT("custom_start_ota_download %d \r\n",rett);
+        if(rett!=0)
+        SystemupgradeView::GetInstance()->set_string_value(NULL,false);
+        // SystemupgradeView::GetInstance()->init_fail(0);
+        return ERRCODE_SUCC;
+    }
+
+
+
+
+    
+
+    //httpc_result_fn *result_fn;
+   
 
     SystemupgradeView::SystemupgradeView()
     {
@@ -28,20 +268,100 @@ namespace OHOS
 
     void SystemupgradeView::ClearAll()
     {
-        if (initViewStatus == true)
+        // if (initViewStatus == true)
+        // {
+        if(scrollView)
         {
             scrollView->RemoveAll();
-            delete FactoryResetImage;
-            FactoryResetImage = nullptr;
-            delete FactoryResetButtonCheckOn;
-            FactoryResetButtonCheckOn = nullptr;
-            delete FactoryResetButtonCheckOff;
-            FactoryResetButtonCheckOff = nullptr;
+            if(container_fail)
+            {
+                container_fail->RemoveAll();
+                if(label1_fail)
+                {
+                    delete label1_fail;
+                }
+                label1_fail=nullptr;
+
+                if(labelButton1_exit)
+                {
+                    delete labelButton1_exit;
+                }
+                labelButton1_exit=nullptr;
+
+                delete container_fail;
+                container_fail = nullptr;
+            }
+            if(container_updating)
+            {
+                container_updating->RemoveAll();
+                if(label_updating)
+                {
+                    delete label_updating;
+                }
+                label_updating=nullptr;
+                delete label_updating;
+                label_updating = nullptr;
+            }
+            if(newVersionTitle)
+            {
+                delete newVersionTitle;
+            }
+            newVersionTitle=nullptr;
+
+            if(newVersion)
+            {
+                delete newVersion;
+            }
+            newVersion=nullptr;
+
+            if(systemupgrade)
+            {
+                delete systemupgrade;
+            }
+            systemupgrade=nullptr;
+
+            if(FirmwareVersionTitle)
+            {
+                delete FirmwareVersionTitle;
+            }
+            FirmwareVersionTitle=nullptr;
+
+            if(FirmwareVersion)
+            {
+                delete FirmwareVersion;
+            }
+            FirmwareVersion=nullptr;
+
+            if(new_label)
+            {
+                delete new_label;
+            }
+            new_label=nullptr;
+
+            
+            if(SystemUpgradeButton_)
+            {
+                delete SystemUpgradeButton_;
+            }
+            SystemUpgradeButton_=nullptr;
+
+        }
+            scrollView->RemoveAll();
             delete scrollView;
             scrollView = nullptr;
-        }
+
+        const power_display_svr_api_t *display_api = power_display_svr_get_api();
+         if (display_api->get_screen_state() != SCREEN_ON)
+         {   
+               display_api->turn_on_screen();  
+         }
+        int t=ConfigModel::GetInstance()->GetScreenDurationRadioButtonSlectValue();
+        display_api->set_screen_set_keepon_timeout(5000+t*5000);
+       // }
     }
 
+
+
     UILabel *SystemupgradeView::InitLabel(LabelConfig &labelConfig)
     {
         UILabel *label = new UILabel();
@@ -58,6 +378,165 @@ namespace OHOS
         label->SetFont(DEFAULT_VECTOR_FONT_FILENAME, labelConfig.fontSize);
         return label;
     }
+    void SystemupgradeView::statr_down_fwpkg(void)
+    {
+        if(is_new_version)
+        {
+            //下载差分包
+            //**********
+            container_updating->SetVisible(true);
+            scrollView->SetTouchable(false);
+            scrollView->SetDraggable(false);
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "custom_start_ota_download_ui_1");
+            custom_start_ota_download_ui_1(uri_ota_package,(uint8_t*)Path_ota_package,false);
+        }
+    }
+
+    void SystemupgradeView::set_string_value(char *str,bool falg)
+    {
+        if(falg)
+        {
+            newVersion->SetText(str);
+            newVersionTitle->SetText("有最新固件版本");
+            newVersion->SetVisible(true);
+            newVersionTitle->SetVisible(true);
+            new_label->SetVisible(true);
+            is_new_version=true;
+
+        }
+        else
+        {
+            newVersionTitle->SetText("已是最新固件版本");
+            newVersionTitle->SetVisible(true);
+            is_new_version=false;
+    
+        }
+        UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(SystemPresenter::GetInstance());
+        if (draglistener == nullptr)
+        {
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!");
+            return ;
+        }
+        scrollView->SetOnDragListener(draglistener);
+        
+        RootView::GetInstance()->Invalidate();
+    }
+
+     void SystemupgradeView::statr_upgrade(void)
+    {
+        if(is_fwpkg_ready)
+        {
+            // char* Path="/user/data/update.fwpkg";
+            // FILE * fp = fopen(Path,"rb");
+            // if(fp!=NULL)
+            // {
+            //     fclose(fp);
+            //     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "file open succse fwpkg_is_ready");
+            // }
+            //开始升级
+            //**********
+            statr_down_fwpkg();
+        }
+    }
+
+    void SystemupgradeView::init_updating(void)
+    {
+        if (container_updating == nullptr) {
+        container_updating = new UIViewGroup();
+        container_updating->SetPosition(0, 0, 466, 480);
+        //container_updating->SetStyle(STYLE_BACKGROUND_OPA, 0);
+        }
+
+          if (label_updating == nullptr) {
+            label_updating = new UILabel();
+        }
+        label_updating->SetPosition(94, 207);         // widget's left position and top position
+        label_updating->Resize(425, 132);          // widget's width and height
+        label_updating->SetViewId("label1");// Set style
+        label_updating->SetStyle(STYLE_TEXT_FONT, 50);
+
+        // Set additional property
+        label_updating->SetText("updating.....");
+        label_updating->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label_updating->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label_updating->SetRollSpeed(0);
+        label_updating->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 50);
+
+        // Add to rootView
+        container_updating->Add(label_updating);
+        container_updating->SetVisible(false);
+        container_updating->SetTouchable(false);
+        container_updating->SetDraggable(false);
+        scrollView->Add(container_updating);
+
+
+    }
+
+    void SystemupgradeView::init_fail(uint8_t falg)
+    {
+        if (container_fail == nullptr) {
+        container_fail = new UIViewGroup();
+        container_fail->SetPosition(0, 0, 466, 480);
+       // container_fail->SetStyle(STYLE_BACKGROUND_OPA, 0);
+        }
+
+       if (label1_fail == nullptr) {
+        label1_fail = new UILabel();
+        }
+        label1_fail->SetPosition(81, 207);         // widget's left position and top position
+        label1_fail->Resize(454, 142);  
+        // label1_fail->SetPosition(197, 207);         // widget's left position and top position
+        // label1_fail->Resize(425, 132);          // widget's width and height
+        label1_fail->SetViewId("label1");// Set style
+        label1_fail->SetStyle(STYLE_TEXT_FONT, 50);
+
+        // Set additional property
+        if(falg==0)
+        {
+            label1_fail->SetText("updating fail");
+        }
+        else
+        {
+            label1_fail->SetText("download fail");
+        }
+        
+        label1_fail->SetLineBreakMode(UILabel::LINE_BREAK_ADAPT);
+        label1_fail->SetAlign(TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_CENTER);
+        label1_fail->SetRollSpeed(0);
+        label1_fail->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 50);
+
+        // Add to rootView
+        container_fail->Add(label1_fail);
+        label1_fail->SetVisible(true);
+        
+        // Add LabelButtonExt to App
+        if (labelButton1_exit == nullptr) {
+            labelButton1_exit = new UILabelButtonExt();
+        }
+        labelButton1_exit->SetPosition(156, 326);         // widget's left position and top position
+        labelButton1_exit->Resize(153, 64);          // widget's width and height
+        labelButton1_exit->SetViewId("labelButton1_exit");// Set style
+
+        // Set additional property
+        labelButton1_exit->SetText("退出");
+        labelButton1_exit->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 35);
+        labelButton1_exit->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+        labelButton1_exit->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+        UIView::OnClickListener *clickListener = static_cast<UIView::OnClickListener *>(SystemPresenter::GetInstance());
+        labelButton1_exit->SetOnClickListener(clickListener);
+        // Add to rootView
+        container_fail->SetTouchable(true);
+        container_fail->Add(labelButton1_exit);
+        container_fail->SetVisible(true);
+        scrollView->Add(container_fail);
+        scrollView->SetTouchable(true);
+        scrollView->SetDraggable(true);
+        RootView::GetInstance()->Invalidate();
+    }
+
+
+
+
 
     UIScrollView *SystemupgradeView::SystemupgradeViewInit(void)
     {
@@ -75,13 +554,7 @@ namespace OHOS
         scrollView->SetReboundSize(50);
         scrollView->SetDirection(1);
 
-        UIView::OnDragListener *draglistener = static_cast<UIView::OnDragListener *>(SystemPresenter::GetInstance());
-        if (draglistener == nullptr)
-        {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::draglistener can not be nullptr!");
-            return NULL;
-        }
-        scrollView->SetOnDragListener(draglistener);
+       
         scrollView->SetTouchable(true);
         scrollView->SetDraggable(true);
 
@@ -127,7 +600,7 @@ namespace OHOS
         uapi_get_buildversion((uint8_t*)version_buf,version_len);
         Config = {
             .left = 37,
-            .top = 110,
+            .top = 135,
             .width = 400,
             .height = 30,
             .fontSize = 26,
@@ -145,8 +618,8 @@ namespace OHOS
         scrollView->Add(FirmwareVersion);
 
              Config = {
-            .left = 168,
-            .top = 200,
+            .left = 140,
+            .top = 210,
             .width = 120,
             .height = 35,
             .fontSize = 30,
@@ -160,6 +633,7 @@ namespace OHOS
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersionTitle new fail!");
             return nullptr;
         }
+        newVersionTitle->SetVisible(false);
         scrollView->Add(newVersionTitle);
 
         char version_buf_1[128]={0};
@@ -167,7 +641,7 @@ namespace OHOS
         uapi_get_buildversion((uint8_t*)version_buf_1,version_len);
         Config = {
             .left = 37,
-            .top = 210,
+            .top = 240,
             .width = 400,
             .height = 30,
             .fontSize = 26,
@@ -182,50 +656,98 @@ namespace OHOS
             return nullptr;
         }
         newVersion->SetTextColor(Color::GetColorFromRGBA(0xff, 0xff, 0xff, 0x87));
+        newVersion->SetTouchable(true);
+        newVersion->SetViewId("newVersion");
+        UIView::OnClickListener *clickListener = static_cast<UIView::OnClickListener *>(SystemPresenter::GetInstance());
+        newVersion->SetOnClickListener(clickListener);
+        newVersion->SetVisible(false);
         scrollView->Add(newVersion);
 
-        UILabelButtonExt * SystemUpgradeButton = new UILabelButtonExt();
-        if (SystemUpgradeButton == nullptr)
+         Config = {
+            .left = 367,
+            .top = 240,
+            .width = 45,
+            .height = 30,
+            .fontSize = 26,
+            .lineHeigh = 30,
+            .text = "新!",
+            .lineBreakMode = UILabel::LINE_BREAK_WRAP,
+        };
+        new_label = InitLabel(Config);
+        if (FirmwareVersion == nullptr)
         {
-            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemUpgradeButtonExt new fail!");
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::FirmwareVersion new fail!");
+            return nullptr;
         }
-        SystemUpgradeButton->SetPosition(43, 400, 100, 100);
-        SystemUpgradeButton->SetViewId(SYSTEM_UPGRADE);
-        SystemUpgradeButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
-        //SystemUpgradeButton->SetImagePosition(326, 37);
-        //SystemUpgradeButton->SetImageSrc("/user/res/SETTING_NEXT.bin", "/user/res/SETTING_NEXT.bin");
-        SystemUpgradeButton->SetText("开始下载");
-        SystemUpgradeButton->SetAlign(TEXT_ALIGNMENT_LEFT);
-        SystemUpgradeButton->SetLabelPosition(45, 0);
-        SystemUpgradeButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);
-        SystemUpgradeButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
-        scrollView->Add(SystemUpgradeButton);
-
-        UILabelButtonExt * SystemUpgradeButton_2 = new UILabelButtonExt();
-        if (SystemUpgradeButton == nullptr)
+        new_label->SetTextColor(Color::GetColorFromRGBA(0xff, 0x00, 0x00, 0x87));
+        new_label->SetVisible(false);
+        scrollView->Add(new_label);
+
+        // UILabelButtonExt * SystemUpgradeButton = new UILabelButtonExt();
+        // if (SystemUpgradeButton == nullptr)
+        // {
+        //     WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemUpgradeButtonExt new fail!");
+        // }
+        // SystemUpgradeButton->SetPosition(43, 400, 200, 100);
+        // SystemUpgradeButton->SetViewId(SYSTEM_UPGRADE);
+        // SystemUpgradeButton->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+        // SystemUpgradeButton->SetText("下载");
+        // SystemUpgradeButton->SetAlign(TEXT_ALIGNMENT_LEFT);
+        // SystemUpgradeButton->SetLabelPosition(45, 0);
+        // SystemUpgradeButton->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 25);
+        // SystemUpgradeButton->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+        // scrollView->Add(SystemUpgradeButton);
+
+        SystemUpgradeButton_ = new UILabelButtonExt();
+        if (SystemUpgradeButton_ == nullptr)
         {
             WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "SystemView::SystemUpgradeButtonExt new fail!");
         }
-        SystemUpgradeButton_2->SetPosition(163, 400, 100, 100);
-        SystemUpgradeButton_2->SetViewId(SYSTEM_UPGRADE);
-        SystemUpgradeButton_2->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
-        //SystemUpgradeButton->SetImagePosition(326, 37);
-        //SystemUpgradeButton->SetImageSrc("/user/res/SETTING_NEXT.bin", "/user/res/SETTING_NEXT.bin");
-        SystemUpgradeButton_2->SetText("开始升级");
-        SystemUpgradeButton_2->SetAlign(TEXT_ALIGNMENT_LEFT);
-        SystemUpgradeButton_2->SetLabelPosition(45, 0);
-        SystemUpgradeButton_2->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 20);
-        SystemUpgradeButton_2->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
+        SystemUpgradeButton_->SetPosition(163, 400, 180, 80);
+        SystemUpgradeButton_->SetViewId(SYSTEM_UPGRADE);
+        SystemUpgradeButton_->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);
+        SystemUpgradeButton_->SetText("确认升级");
+        SystemUpgradeButton_->SetAlign(TEXT_ALIGNMENT_LEFT);
+        SystemUpgradeButton_->SetLabelPosition(45, 0);
+        SystemUpgradeButton_->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 25);
+        SystemUpgradeButton_->SetStyleForState(STYLE_BORDER_COLOR, 0xff0b1928, UIButton::PRESSED);
         
 
         UIView::OnClickListener *Click = static_cast<UIView::OnClickListener *>(SystemPresenter::GetInstance());
-        SystemUpgradeButton_2->SetOnClickListener(Click);
-        scrollView->Add(SystemUpgradeButton_2);
-        //SystemUpgradeButton->SetOnClickListener(clickListener);
-        
+        SystemUpgradeButton_->SetOnClickListener(Click);
+        scrollView->Add(SystemUpgradeButton_);
+
+
+        init_updating();
 
+        //init_fail();
     
+        //SystemUpgradeButton->SetOnClickListener(clickListener);
+
+        //char *Path= "/user/data/ota_start_1.json";
+  
+         FILE * fp = fopen(Path,"rb");
+         if(fp!=NULL)
+         {
+            fclose(fp);
+            int  ret= remove(Path);
+            WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "file remove!!!!!!!!!!!!! %d  ",ret);
+         }
        
+
+        const power_display_svr_api_t *display_api = power_display_svr_get_api();
+        if (display_api->get_screen_state() != SCREEN_ON)
+         {   
+               display_api->turn_on_screen();  
+         }  
+        display_api->set_screen_set_keepon_timeout(-1);
+        memset(uri,0,256);
+        char *imei_str= ConfigModel::GetInstance()->Getimei();
+        sprintf((char *)uri,"http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=%s&imei=%s",version_buf,imei_str);
+        custom_start_ota_download_ui_1(uri,(uint8_t*)Path,true);
+
+        //uograde_service_service_init();
+        
         return scrollView;
     }
 
index c833df4..0c68d2e 100755 (executable)
@@ -12,6 +12,7 @@ set(PRIVATE_HEADER
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/callerlog/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/phoneservice/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/producttest/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/config/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/main/include/dial
     ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/bloodoxygen/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/heartrate/include
@@ -103,6 +104,7 @@ set(PRIVATE_HEADER
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/alarmclocktimerconfig/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/alarm/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/producttest/include
+    ${CMAKE_CURRENT_SOURCE_DIR}/../../fd230app/nativeui/config/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/callerlog/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/phoneservice/include
     ${CMAKE_CURRENT_SOURCE_DIR}/../../nativeapp/nativeui/main/include
index 642c0a7..e1cb869 100755 (executable)
@@ -36,6 +36,7 @@
 #include "testchanging.h"
 #include "testcat1.h" 
 #include "testhrsenson.h" 
+#include "ConfigModel.h"
 namespace OHOS {
 
 #ifdef __cplusplus
@@ -487,6 +488,7 @@ void MsgCenterNotifyCat1SignalUpdateProc(const Topic topic, Request* req)
         tokbuf=strtok(NULL,",");
         cat1_msg_T.imei=(char*)malloc(strlen(tokbuf));
         strcpy( cat1_msg_T.imei,tokbuf);
+        ConfigModel::GetInstance()->Setimei(cat1_msg_T.imei);
         WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",cat1_msg_T.imei);
         tokbuf=strtok(NULL,":");
         tokbuf=strtok(NULL,",");
index 6a94c08..df87b51 100644 (file)
@@ -412,11 +412,13 @@ static int udp_packet_parse(char *rx_buffer, int len)
                            index = cat1_handle_call_disconnected(msg);
                 break;
             case UDP_CMD_CAT1_OTA_UPDATE:
-                printf("CAT1_OTA_UPDATE reply %s",msg->buffer);
+                printf("CAT1_OTA_UPDATE reply %s\n",msg->buffer);
                 break;
             case UDP_MSG_REPLY:
-                printf("UDP_MSG_REPLY reply %s",msg->buffer);
-                
+                printf("UDP_MSG_REPLY reply %s\n",msg->buffer);
+                //BOOTUP,pyVer,PY_SRV_V4,modemVer,EG810MCNLAR06A01M08_VOLTE_OCPU_QPY_BETA0312
+                if(strstr(msg->buffer,"BOOTUP")!=NULL)
+                cat1_getsignal();
                 break;
              case UDP_CMD_GET_CAT1VER:
                 index = cat1_handle_networ_msg(msg);