do_cywee_service_check_msg(CYWEE_SERVICE_CMD_SAVE_DATA,NULL);
addressbookTowrite();
-
- uapi_calendar_store_date();
//同步所有需要保存实时数据到config文件
uapi_dev_runtime_sync_runtime_env_to_config();
//保存config文件到磁盘
sync_all_config_to_disk();
+ //重启前要保存时间
+ uapi_calendar_store_date();
}
static bool doing_shutdown_or_reboot = false;
void shutdown_reboot_prejobs(void)
return ret;
}
+#include "chip_system_time.h"
+void test_bandy_time(uint32_t time)
+{
+ struct tm tm;
+ struct timeval tv;
+ // uint32_t time = 1716044461; // 2024-5-18 15:1:1 网站转换:2024-05-18 23:01:01
+ printf("--------SYNC TIME----------\r\n");
+ get_current_timestamp();
+ get_current_time(&tv, &tm);
+ sync_time(time, 8);
+ get_current_timestamp();
+ get_current_time(&tv, &tm);
+ printf("--------SAVE TIME----------\r\n");
+ get_current_timestamp();
+ get_current_time(&tv, &tm);
+ save_time();
+ get_current_timestamp();
+ get_current_time(&tv, &tm);
+ printf("--------RESTORE TIME----------\r\n");
+ get_current_timestamp();
+ get_current_time(&tv, &tm);
+ restore_time();
+ get_current_timestamp();
+ get_current_time(&tv, &tm);
+}
+
+
#include "tyhx_hrs_custom.h"
void get_ppg_id(void)
return ERRCODE_SUCC;
}
+static uint32_t custom_test_time_synct(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
+{
+ UNUSED(strCommonCmd);
+ uint8_t argv[CUSTOM_UTILS_MAX_ARGC][CUSTOM_UTILS_MAX_ARGV_LEN] = { 0 };
+ uint32_t argc = 0;
+
+ int ret = ConvertCmdToParam(para, paraLen, argv, &argc);
+ if (ret != CUSTOM_UTILS_SUCCESS) {
+ PRINT("CUSTOM_UTILSTEST ATCMD Convert Command Failed\n");
+ return ERRCODE_FAIL;
+ }
+
+ if (argc != 1) {
+ PRINT("CUSTOM_UTILSTEST ATCMD Set Parameter Failed argc %d\n",argc);
+ return ERRCODE_FAIL;
+ }
+ uint32_t inpdustr = atol((char*)argv[0]);
+
+
+ test_bandy_time(inpdustr);
+
+ return ERRCODE_SUCC;
+}
+
#include "lwip/apps/sntp.h"
static uint32_t custom_test_sntp(uint8_t *para, uint32_t paraLen, char *strCommonCmd)
{ (char *)"AT^LZMADEC", custom_utils_lzmadec, (char *)" " },
{ (char *)"AT^PDUDEC", custom_utils_pdudec, (char *)" " },
{ (char *)"AT^SNTP", custom_test_sntp, (char *)" " },
+ { (char *)"AT^TIMESYNC", custom_test_time_synct, (char *)" " },
return settimeofday(&tv, &tzone);
}
-void test_bandy_time(void)
-{
- struct tm tm;
- struct timeval tv;
- uint32_t time = 1716044461; // 2024-5-18 15:1:1
- printf("--------SYNC TIME----------\r\n");
- get_current_timestamp();
- get_current_time(&tv, &tm);
- sync_time(time, 8);
- get_current_timestamp();
- get_current_time(&tv, &tm);
- printf("--------SAVE TIME----------\r\n");
- get_current_timestamp();
- get_current_time(&tv, &tm);
- save_time();
- get_current_timestamp();
- get_current_time(&tv, &tm);
- printf("--------RESTORE TIME----------\r\n");
- get_current_timestamp();
- get_current_time(&tv, &tm);
- restore_time();
- get_current_timestamp();
- get_current_time(&tv, &tm);
-}
+// void test_bandy_time(uint32_t time)
+// {
+// struct tm tm;
+// struct timeval tv;
+// uint32_t time = 1716044461; // 2024-5-18 15:1:1 网站转换:2024-05-18 23:01:01
+// printf("--------SYNC TIME----------\r\n");
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// sync_time(time, 8);
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// printf("--------SAVE TIME----------\r\n");
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// save_time();
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// printf("--------RESTORE TIME----------\r\n");
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// restore_time();
+// get_current_timestamp();
+// get_current_time(&tv, &tm);
+// }
#endif
\ No newline at end of file
* @brief use for test
* @return void.
*/
-void test_time(void);
+void test_bandy_time(uint32_t time);
/**
* @brief Get the current system time as a local timestamp with timezone offset