SOS增加文件保存 1041/2
authorhcj <1224667075@qq.com>
Fri, 27 Sep 2024 10:57:24 +0000 (18:57 +0800)
committerhcj <1224667075@qq.com>
Fri, 27 Sep 2024 10:57:24 +0000 (18:57 +0800)
code/sdk/application/wearable/fd230app/nativeui/alipay/src/AlipaySetting.cpp
code/sdk/application/wearable/fd230app/nativeui/phone/src/phoneaddressmodel.cpp
code/sdk/application/wearable/service/ble_service/blemoder/bletest.cpp
code/sdk/application/wearable/service/ble_service/blemoder/bletest.h
code/sdk/drivers/peripheral/utils/custom_utils.c

index c889eff..09ad20c 100644 (file)
@@ -10,6 +10,7 @@
 #include "cmsis_os.h"\r
 #include "AlipaySetting.h"\r
 #include "AlipayModel.h"\r
+#include "uicomponents/UIComponents.h"\r
 \r
 namespace OHOS {\r
 static const char *SETTING_TITLE = (char *)"设置";\r
@@ -111,8 +112,11 @@ bool AlipaySetting::AlipayInitLabel(void)
     }\r
     uint8_t str[ALIPAY_GET_NICKNAME_MAX_LENGTH] = {0};\r
     presenter_->AlipayGetNickName(str);\r
-    labelName->SetText((const char *)str);\r
-    labelName->SetFont(DEFAULT_VECTOR_FONT_FILENAME, SETTING_NAME_FONT);\r
+    uint8_t str_[ALIPAY_GET_NICKNAME_MAX_LENGTH] = {0};\r
+    updata_char((char *)str_,(char *)str,ALIPAY_GET_NICKNAME_MAX_LENGTH);\r
+    labelName->SetText((const char *)str_);\r
+    labelName->SetFont(DEFAULT_VECTOR_FONT_FILENAME_EN, SETTING_NAME_FONT);\r
+\r
     labelName->SetPosition(SETTING_NAME_X, SETTING_NAME_Y, SETTING_NAME_WIDTH, SETTING_NAME_HEIGHT);\r
     labelName->SetLineBreakMode(UILabel::LINE_BREAK_MARQUEE);\r
     labelName->SetStyle(STYLE_TEXT_FONT, SETTING_NAME_FONT);\r
index e63161b..9954351 100644 (file)
@@ -356,7 +356,7 @@ namespace OHOS
         return address_number;
     }
 
-    #define SOS_NUMBER_PATH "user/userdata/sos_number.bin"
+    #define SOS_NUMBER_PATH "/user/userdata/sos_number.bin"
 
     #define SOS_NUMBER_MAX 3
 
@@ -371,8 +371,6 @@ namespace OHOS
         {
             for(int i=0;i<sos_num;i++)
             {
-                // char W_buf[20]={0};
-                // memcpy_s(W_buf,20,sos_dail_buf[i],osal_strlen((const char*)sos_dail_buf[i]));
                 fwrite(&sos_number_data[i],1,sizeof(sos_number_t),fp);
             }
             fclose(fp);
index 4f0ecd2..034ea5c 100644 (file)
@@ -87,6 +87,16 @@ extern "C" {
 #include "alipay_feature.h"
 #include "transmitting.h"
 
+void ble_sos_data_save(void)
+{
+    OHOS::SOS_number_save();
+}
+
+void ble_SOS_data_init(void)
+{
+    OHOS::SOS_number_init();
+}
+
 void ota_updata_init(void)
 {
    OHOS::get_updatafail_data();
@@ -209,7 +219,7 @@ bool Ble_Set_ScheduleInfo(uint8_t id,uint32_t timetamp_begin,uint32_t timetamp_e
     //printf("delete_before_file now day%d %d %d\r\n ",y,m,d);
 
     // OHOS::C_ScheduleSetByApp(&info_, id - 1, is_end);
-    C_ScheduleSetByApp(&info_, id - 1, is_end);
+    C_ScheduleSetByApp(&info_, id-1, is_end);
 
     if(is_end)
     printf("////////////////////结束///////////////////\r\n");
index 1721e79..a9354a2 100644 (file)
@@ -384,6 +384,10 @@ void ota_updata_init(void);
 
 bool delete_MP3_file_By_ID(uint16_t id);
 
+void ble_sos_data_save(void);
+
+void ble_SOS_data_init(void);
+
 #ifdef __cplusplus
 #if __cplusplus
 }
index fcf469b..3f7c02d 100644 (file)
@@ -195,6 +195,8 @@ void shutdown_reboot_prejobs_task(void)
 
     addressbookTowrite();
 
+    ble_sos_data_save();
+
     //保存信息文件
     saveancsdata();
     //保存当天心率数据
@@ -383,7 +385,11 @@ void startup_post_init_task(void)
     }
 
     addressbookToRead(NULL);
+
+    ble_SOS_data_init();
+
     up_report_timer();
+
     read_jsonHistory_weather();
 
     ota_updata_init();