|
@@ -325,6 +325,38 @@ void web_SetLanInfo(Webs *wp){
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+void web_GetRunTime(Webs *wp){
|
|
|
|
+ uint16_t wRet = LIBIPMI_E_SUCCESS;
|
|
|
|
+ IPMI20_UDS_SESSION_T UDSSession;
|
|
|
|
+ uint8_t target_addr;
|
|
|
|
+ uint32_t TotalRunTime = 1000; //模块总运行时间,单位: 分钟
|
|
|
|
+ uint32_t CurRunTime = 50; //模块本次运行时间,单位: 分钟
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ cJSON * root = cJSON_CreateObject();
|
|
|
|
+ cJSON * data = cJSON_CreateObject();
|
|
|
|
+ cJSON_AddItemToObject(root, "data", data);//根节点下添加
|
|
|
|
+ cJSON_AddNumberToObject(data, "TotalRunTime", TotalRunTime);
|
|
|
|
+ cJSON_AddNumberToObject(data, "CurRunTime", CurRunTime);
|
|
|
|
+ cJSON_AddStringToObject(root, "msg", "");
|
|
|
|
+ cJSON_AddNumberToObject(root, "code", 200);
|
|
|
|
+
|
|
|
|
+ char *pStr;
|
|
|
|
+ pStr = cJSON_PrintUnformatted(root);
|
|
|
|
+ websSetStatus(wp, 200);
|
|
|
|
+ websWriteHeaders(wp, -1, 0);
|
|
|
|
+ websWriteEndHeaders(wp);
|
|
|
|
+ websWrite(wp,"%s", pStr);
|
|
|
|
+ websFlush(wp, 0);
|
|
|
|
+ websDone(wp);
|
|
|
|
+ printf("cJSON:%s\n", pStr);
|
|
|
|
+
|
|
|
|
+ if(pStr)
|
|
|
|
+ wfree(pStr);
|
|
|
|
+ if(root)
|
|
|
|
+ cJSON_Delete(root);
|
|
|
|
+}
|
|
|
|
+
|
|
/*
|
|
/*
|
|
index = 0,1,2,3,4,5
|
|
index = 0,1,2,3,4,5
|
|
*/
|
|
*/
|