#include "unistd.h"
+#include "custom_save_runtime.h"
+
+
#define RUNTIME_LOG_SAVE_PATH EXC_TAR_PATH
return ERRCODE_SUCC;
}
+errcode_t uapi_save_runtime_log_Time(void)
+{
+ int ret;
+
+ custom_cmd_t mail = {0};
+ time_t currtime;
+ time(&currtime);
+ mail.cmd = RUNTIME_LOG_RTC_TIME;
+ mail.time= (uint32_t)(currtime);
+
+ PRINT("uapi_save_runtime_log_Time:%d\r\n",mail.time);
+
+ if(custom_running_log_state_stat==0 || g_runtime_log_queue_created==0)
+ {
+ PRINT("Error task or queue no ready\r\n");
+ return ERRCODE_FAIL;
+ }
+ ret = osal_msg_queue_write_copy(g_custom_runtime_log_cmd_queue, (void *)&mail, sizeof(custom_cmd_t), 0);
+
+ if (ret != OSAL_SUCCESS)
+ {
+ // PRINT("Error custom_cmd Check MSG 0x%02X send failed! err=0x%x! \r\n", cmd, ret);
+ return ERRCODE_FAIL;
+ }
+
+ return ERRCODE_SUCC;
+
+}
+
#define RUNTIME_FILE_PATH "%s/%s_runtime_%d.bin"
void create_runtime_log_path(char *path,uint16_t max_len,uint8_t count)
uint32_t msgsize = (uint32_t)sizeof(custom_cmd_t);
custom_running_log_state_stat = true;
int code=0;
-
+
while (1)
{
ret = osal_msg_queue_read_copy(g_custom_runtime_log_cmd_queue, (void *)&mail, &msgsize,
RUNTIME_LOG_BLE_CONNECT_UPDATE =0x1400,//ble连接参数
-
+ RUNTIME_LOG_RTC_TIME =0x1500, //时间记录
//电压变化
RUNTIME_LOG_BAT_VOL_LOW = 0xe000, //3V
RUNTIME_LOG_BAT_VOL_HIGH =0xf000, //4V
+
+
} runtime_log_cmd_Id;
errcode_t uapi_save_runtime_log(uint16_t cmd);
+ errcode_t uapi_save_runtime_log_Time(void);
+
errcode_t uapi_runtime_log_service_init(void);
#ifdef __cplusplus