801添加系统时间
This commit is contained in:
1 parent
62f9535ae6
commit
01b7398338
1 file changed
+5
@@ -124,8 +124,13 @@ void pasre_DAT(const char *api, const char *json_str)
|
||||
}
|
||||
if (strcmp(api, "SC801") == 0)
|
||||
{// 处理 SC801系统信息
|
||||
char systime[18] = {0}; // 初始化为 0
|
||||
rt_snprintf(systime, sizeof(systime),"%d-%d-%d_%d:%d:%d",
|
||||
sys_time[5], sys_time[4], sys_time[3],sys_time[2],sys_time[1], sys_time[0]);
|
||||
|
||||
cJSON_AddItemToObject(dat,"SYSTEMP",cJSON_CreateNumber(sys_temperature));
|
||||
cJSON_AddItemToObject(dat,"SYSHUM",cJSON_CreateNumber(sys_humidity));
|
||||
cJSON_AddItemToObject(dat,"SYSTIME",cJSON_CreateString(systime));
|
||||
}
|
||||
else if (strcmp(api, "SC810") == 0)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user