编译通过

This commit is contained in:
zogodo
2019-12-26 21:06:54 +08:00
parent 8fee104f50
commit f8a4404614
3 changed files with 8 additions and 6 deletions

View File

@@ -43,7 +43,7 @@
#include "user_power.h" #include "user_power.h"
#include "main.h" #include "main.h"
#include "web_data.c" #include "web_data.c"
#include"timed_task/timed_task.h" #include "timed_task/timed_task.h"
static bool is_http_init; static bool is_http_init;
static bool is_handlers_registered; static bool is_handlers_registered;
@@ -219,14 +219,15 @@ static int HttpAddTask(httpd_request_t *req)
//TODO <20><>url<72><6C>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD> //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>. 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); 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; OSStatus err = kNoErr;
send_http(mess, strlen(mess), exit, &err); send_http(mess, strlen(mess), exit, &err);
exit: exit:
return err;
} }
static int HttpDelTask(httpd_request_t *req) static int HttpDelTask(httpd_request_t *req)
@@ -237,11 +238,12 @@ static int HttpDelTask(httpd_request_t *req)
int time; int time;
sscanf(buf, "%d", &time); sscanf(buf, "%d", &time);
char mess[] = DelTask(time) ? "OK" : "NO"; char* mess = DelTask(time) ? "OK" : "NO";
OSStatus err = kNoErr; OSStatus err = kNoErr;
send_http(mess, strlen(mess), exit, &err); send_http(mess, strlen(mess), exit, &err);
exit: exit:
return err;
} }
struct httpd_wsgi_call g_app_handlers[] = { struct httpd_wsgi_call g_app_handlers[] = {

View File

@@ -8,7 +8,7 @@
#include "mqtt_server/user_mqtt_client.h" #include "mqtt_server/user_mqtt_client.h"
#include "mqtt_server/user_function.h" #include "mqtt_server/user_function.h"
#include "http_server/app_httpd.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__) #define os_log(format, ...) custom_log("TC1", format, ##__VA_ARGS__); web_log(format, ##__VA_ARGS__)

View File

@@ -64,7 +64,7 @@ bool DelTask(int time)
{ {
pTimedTask tmp = task_top; pTimedTask tmp = task_top;
task_top = task_top->next; task_top = task_top->next;
free(task_top); free(tmp);
return true; return true;
} }
else if (task_top->next == NULL) else if (task_top->next == NULL)