#include "components/ui_label_ext.h"
#include "components/ui_label_button_ext.h"
#include "cat1_ctl.h"
-
+#include "upg_common_porting.h"
#if USE_THISIOT
#define HTTP_JSON_SERVER_NAME "test.iot.api.thisiot.com"//"test.app.api.thisiot.com"//获取升级服务器
* http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=V1.1_20240316_115535&imei=864430010001091
查看 返回的"UptoDate" == False,即可根据"url"地址下载,文件校验可以后面再加。
{ "UptoDate": false ,
- "url" : "http://icfota.snicker.com.cn:8089/FD230/V1.1_20240316_115535/update.fwpkg",
-"OtaPackageLength" : 177504,
- "OtaPackageName" : "update.fwpkg",
+
"OtaPackageVersion" : "V1.1_20240316_130929",
"SystemVersion" : "V1.1_20240316_115535",
"description" : " update to checkota version 3 ",
#define UPDATAJSONPATH "/user/update/ota_start_.json"//获取升级的得到的json
#define UPDATAREPORT "/user/update/ota_start_reported_.json"//点升级后保存下来的json
-#define UPDATAFWPKGPATH "/user/update/update.fwpkg" //升级包
+#define UPDATAFWPKGPATH UPG_FILE_NAME //升级包
#define UPDATAREPORT_ "/user/update/ota_report_.json"//上报升级得到的json
#else
#define UPDATAJSONPATH "/update/ota_start_.json"//获取升级的得到的json
#define UPDATAREPORT "/update/ota_start_reported_.json"//点升级后保存下来的json
-#define UPDATAFWPKGPATH "/update/update.fwpkg" //升级包
+#define UPDATAFWPKGPATH UPG_FILE_NAME //升级包
#define UPDATAREPORT_ "/update/ota_report_.json"//上报升级得到的json
#endif
char msg_buf[256]={0};
bool falg=false;
- // if(code==IOT_CODE_SUCCESS)
- // {
- // falg=true;
- // cJSON *data=cJSON_GetObjectItem(root, "data");
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "");
-
- // report_jsonString = cJSON_PrintUnformatted(data);
- // //cJSON_Delete(data);
-
- // if(data!=NULL)
- // {
- // cJSON *downloadFileVo=cJSON_GetObjectItem(data, "downloadFileVo");
-
- // if(downloadFileVo!=NULL)
- // {
-
- // //"http://r-oss.thisiot.com/device-ota/2024_04_22/1782329689464958978.fwpkg?Expires=1713780167&OSSAccessKeyId=LTAI5tJa2arDBmqSUsSTQJ1T&Signature=OlbdNsfnz9Zje6ypFgXINQPXVE0%3D"
- // // char *uri = "http://icfota.snicker.com.cn:8089/FD230/V1.1/update.fwpkg";
- // char *uri = cJSON_GetObjectItem(downloadFileVo, "url")->valuestring;
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "uri %s",uri);
- // sprintf((char *)uri_ota_package,"%s",uri);
- // }
- // }
- // }
- // else
- // {
- // WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "code!=IOT_CODE_SUCCESS");
- // }
+
sprintf(msg_buf,"%s",msg);
WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",msg);
{
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();
#include <iostream>
#include <fstream>
-
+#include "upg_common_porting.h"
#define USE_THISIOT 1
// http://iot.api.thisiot.com/ota/task/v2?deviceId=28110668A5D4&sourceVersion=1.1.41
#if USE_THISIOT
* http://icfota.snicker.com.cn:8089/fd230ota.jsp?product=FD230&pkgver=V1.1_20240316_115535&imei=864430010001091
查看 返回的"UptoDate" == False,即可根据"url"地址下载,文件校验可以后面再加。
{ "UptoDate": false ,
- "url" : "http://icfota.snicker.com.cn:8089/FD230/V1.1_20240316_115535/update.fwpkg",
-"OtaPackageLength" : 177504,
- "OtaPackageName" : "update.fwpkg",
+
"OtaPackageVersion" : "V1.1_20240316_130929",
"SystemVersion" : "V1.1_20240316_115535",
"description" : " update to checkota version 3 ",
#define UPDATAREPORT "/user/update/ota_start_reported_.json"//点升级后保存下来的json
-#define UPDATAFWPKGPATH "/user/update/update.fwpkg" //升级包
+#define UPDATAFWPKGPATH UPG_FILE_NAME //升级包
#define UPDATAREPORT_ "/user/update/ota_report_.json"//上报升级得到的json
#define UPDATAREPORT "/update/ota_start_reported_.json"//点升级后保存下来的json
-#define UPDATAFWPKGPATH "/update/update.fwpkg" //升级包
+#define UPDATAFWPKGPATH UPG_FILE_NAME//升级包
#define UPDATAREPORT_ "/update/ota_report_.json"//上报升级得到的json
#include "msg_center_protocol.h"
#include "wearable_log.h"
#include "upg_porting.h"
+
#ifdef SUPPORT_AUTO_OTA
#include "auto_ota_service.h"
#endif
/* 固定升级包文件长度, "/user/update/update.fwpkg"*/
#ifdef SINGLE_USER_PARTITION
-#define UPGRADE_FILE_PATH "/user/update/update.fwpkg"
+#define UPGRADE_FILE_PATH UPG_FILE_NAME
#else
-#define UPGRADE_FILE_PATH "/update/update.fwpkg"
+#define UPGRADE_FILE_PATH UPG_FILE_NAME
#endif
#define UPGRADE_FILE_LEN strlen(UPGRADE_FILE_PATH)