mirror of
https://github.com/oopuuu/zTC1.git
synced 2025-12-12 13:08:13 +08:00
编译通过
This commit is contained in:
@@ -219,14 +219,15 @@ static int HttpAddTask(httpd_request_t *req)
|
||||
//TODO <20><>url<72><6C>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
|
||||
char buf[16] = "5 1234567 0"; //<2F><><EFBFBD><EFBFBD><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>.
|
||||
|
||||
TimedTask task;
|
||||
struct TimedTask task;
|
||||
sscanf(buf, "%d %d %d", &task.time, &task.socket_idx, &task.on);
|
||||
|
||||
char mess[] = AddTask(task) ? "OK" : "NO";
|
||||
char* mess = AddTask(&task) ? "OK" : "NO";
|
||||
|
||||
OSStatus err = kNoErr;
|
||||
send_http(mess, strlen(mess), exit, &err);
|
||||
exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int HttpDelTask(httpd_request_t *req)
|
||||
@@ -237,11 +238,12 @@ static int HttpDelTask(httpd_request_t *req)
|
||||
int time;
|
||||
sscanf(buf, "%d", &time);
|
||||
|
||||
char mess[] = DelTask(time) ? "OK" : "NO";
|
||||
char* mess = DelTask(time) ? "OK" : "NO";
|
||||
|
||||
OSStatus err = kNoErr;
|
||||
send_http(mess, strlen(mess), exit, &err);
|
||||
exit:
|
||||
return err;
|
||||
}
|
||||
|
||||
struct httpd_wsgi_call g_app_handlers[] = {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include "mqtt_server/user_mqtt_client.h"
|
||||
#include "mqtt_server/user_function.h"
|
||||
#include "http_server/app_httpd.h"
|
||||
#include "time_task/time_task.h"
|
||||
#include "timed_task/timed_task.h"
|
||||
|
||||
#define os_log(format, ...) custom_log("TC1", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ bool DelTask(int time)
|
||||
{
|
||||
pTimedTask tmp = task_top;
|
||||
task_top = task_top->next;
|
||||
free(task_top);
|
||||
free(tmp);
|
||||
return true;
|
||||
}
|
||||
else if (task_top->next == NULL)
|
||||
|
||||
Reference in New Issue
Block a user