From f3d214d4a2490e98ee81ac9b7dc97f87c242bc6a Mon Sep 17 00:00:00 2001 From: zogodo <742782908@qq.com> Date: Sat, 22 Feb 2020 19:20:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AD=A6=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TC1/http_server/app_httpd.c | 9 --------- TC1/timed_task/timed_task.c | 2 +- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/TC1/http_server/app_httpd.c b/TC1/http_server/app_httpd.c index dee59be..36c9c02 100644 --- a/TC1/http_server/app_httpd.c +++ b/TC1/http_server/app_httpd.c @@ -91,15 +91,6 @@ void GetPraFromUrl(char* url, char* pra, char* val) static int HttpGetIndexPage(httpd_request_t *req) { - char* buf = "1678369623 4 0"; - pTimedTask task = (pTimedTask)malloc(sizeof(struct TimedTask)); - sscanf(buf, "%ld %d %d", &task->prs_time, &task->socket_idx, &task->on); - AddTask(task); - - - - - OSStatus err = kNoErr; err = httpd_send_all_header(req, HTTP_RES_200, sizeof(web_index_html), HTTP_CONTENT_HTML_ZIP); diff --git a/TC1/timed_task/timed_task.c b/TC1/timed_task/timed_task.c index eda9f6c..1171b96 100644 --- a/TC1/timed_task/timed_task.c +++ b/TC1/timed_task/timed_task.c @@ -107,7 +107,7 @@ char* GetTaskStr() tm_info = localtime(&prs_time); strftime(buffer, 26, "%m-%d %H:%M:%S", tm_info); - sprintf(tmp_str, "{'timestamp':%d,'prs_time':'%s','socket_idx':%d,'on':%d},", + sprintf(tmp_str, "{'timestamp':%ld,'prs_time':'%s','socket_idx':%d,'on':%d},", tmp_tsk->prs_time, buffer, tmp_tsk->socket_idx, tmp_tsk->on); tmp_str += strlen(tmp_str); tmp_tsk = tmp_tsk->next;