From c81aaa5b083908a3a7eb8c894402069dc6f1f408 Mon Sep 17 00:00:00 2001 From: cskarai Date: Sat, 17 Sep 2016 13:49:40 +0200 Subject: [PATCH] Fixed: WEB_JSON_DATA WEB_DATA change (uses SLIP protocol) --- arduino/libraries/EspLink/EspLink.h | 2 +- arduino/libraries/EspLink/WebServer.cpp | 4 ++-- cmd/cmd.h | 4 ++-- cmd/handlers.c | 2 +- web-server/web-server.c | 2 +- web-server/web-server.h | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arduino/libraries/EspLink/EspLink.h b/arduino/libraries/EspLink/EspLink.h index c13a390..aff43f9 100644 --- a/arduino/libraries/EspLink/EspLink.h +++ b/arduino/libraries/EspLink/EspLink.h @@ -43,7 +43,7 @@ typedef enum { CMD_REST_REQUEST, CMD_REST_SETHEADER, - CMD_WEB_JSON_DATA = 30, + CMD_WEB_DATA = 30, CMD_WEB_REQ_CB, } CmdName; diff --git a/arduino/libraries/EspLink/WebServer.cpp b/arduino/libraries/EspLink/WebServer.cpp index cd0af2c..6a5c270 100644 --- a/arduino/libraries/EspLink/WebServer.cpp +++ b/arduino/libraries/EspLink/WebServer.cpp @@ -77,7 +77,7 @@ void WebServer::invokeMethod(RequestReason reason, WebMethod * method, CmdReques return; } - espLink.sendPacketStart(CMD_WEB_JSON_DATA, 100, 255); + espLink.sendPacketStart(CMD_WEB_DATA, 100, 255); espLink.sendPacketArg(4, remote_ip); espLink.sendPacketArg(2, (uint8_t *)&remote_port); @@ -130,7 +130,7 @@ void WebServer::handleRequest(CmdRequest *req) return; // empty response - espLink.sendPacketStart(CMD_WEB_JSON_DATA, 100, 2); + espLink.sendPacketStart(CMD_WEB_DATA, 100, 2); espLink.sendPacketArg(4, remote_ip); espLink.sendPacketArg(2, (uint8_t *)&remote_port); espLink.sendPacketEnd(); diff --git a/cmd/cmd.h b/cmd/cmd.h index a73119a..be1e684 100644 --- a/cmd/cmd.h +++ b/cmd/cmd.h @@ -49,8 +49,8 @@ typedef enum { CMD_REST_REQUEST, CMD_REST_SETHEADER, - CMD_WEB_JSON_DATA = 30, - CMD_WEB_REQ_CB, + CMD_WEB_DATA = 30, // MCU pushes data using this command + CMD_WEB_REQ_CB, // esp-link WEB callback } CmdName; typedef void (*cmdfunc_t)(CmdPacket *cmd); diff --git a/cmd/handlers.c b/cmd/handlers.c index 834b757..af328e7 100644 --- a/cmd/handlers.c +++ b/cmd/handlers.c @@ -48,7 +48,7 @@ const CmdList commands[] = { {CMD_REST_REQUEST, "REST_REQ", REST_Request}, {CMD_REST_SETHEADER, "REST_SETHDR", REST_SetHeader}, #endif - {CMD_WEB_JSON_DATA, "WEB_JSON_DATA", WEB_JsonData}, + {CMD_WEB_DATA, "WEB_DATA", WEB_Data}, }; //===== List of registered callbacks (to uC) diff --git a/web-server/web-server.c b/web-server/web-server.c index f9651ce..72ee39c 100644 --- a/web-server/web-server.c +++ b/web-server/web-server.c @@ -365,7 +365,7 @@ int ICACHE_FLASH_ATTR WEB_CgiJsonHook(HttpdConnData *connData) return HTTPD_CGI_MORE; } -void ICACHE_FLASH_ATTR WEB_JsonData(CmdPacket *cmd) +void ICACHE_FLASH_ATTR WEB_Data(CmdPacket *cmd) { CmdRequest req; cmdRequest(&req, cmd); diff --git a/web-server/web-server.h b/web-server/web-server.h index e063799..2e3413a 100644 --- a/web-server/web-server.h +++ b/web-server/web-server.h @@ -31,7 +31,7 @@ void WEB_Init(); char * WEB_UserPages(); int WEB_CgiJsonHook(HttpdConnData *connData); -void WEB_JsonData(CmdPacket *cmd); +void WEB_Data(CmdPacket *cmd); #endif /* WEB_SERVER_H */