Fixed: WEB_JSON_DATA WEB_DATA change (uses SLIP protocol)

pull/193/head
cskarai 8 years ago committed by Thorsten von Eicken
parent bee5929751
commit c81aaa5b08
  1. 2
      arduino/libraries/EspLink/EspLink.h
  2. 4
      arduino/libraries/EspLink/WebServer.cpp
  3. 4
      cmd/cmd.h
  4. 2
      cmd/handlers.c
  5. 2
      web-server/web-server.c
  6. 2
      web-server/web-server.h

@ -43,7 +43,7 @@ typedef enum {
CMD_REST_REQUEST, CMD_REST_REQUEST,
CMD_REST_SETHEADER, CMD_REST_SETHEADER,
CMD_WEB_JSON_DATA = 30, CMD_WEB_DATA = 30,
CMD_WEB_REQ_CB, CMD_WEB_REQ_CB,
} CmdName; } CmdName;

@ -77,7 +77,7 @@ void WebServer::invokeMethod(RequestReason reason, WebMethod * method, CmdReques
return; return;
} }
espLink.sendPacketStart(CMD_WEB_JSON_DATA, 100, 255); espLink.sendPacketStart(CMD_WEB_DATA, 100, 255);
espLink.sendPacketArg(4, remote_ip); espLink.sendPacketArg(4, remote_ip);
espLink.sendPacketArg(2, (uint8_t *)&remote_port); espLink.sendPacketArg(2, (uint8_t *)&remote_port);
@ -130,7 +130,7 @@ void WebServer::handleRequest(CmdRequest *req)
return; return;
// empty response // empty response
espLink.sendPacketStart(CMD_WEB_JSON_DATA, 100, 2); espLink.sendPacketStart(CMD_WEB_DATA, 100, 2);
espLink.sendPacketArg(4, remote_ip); espLink.sendPacketArg(4, remote_ip);
espLink.sendPacketArg(2, (uint8_t *)&remote_port); espLink.sendPacketArg(2, (uint8_t *)&remote_port);
espLink.sendPacketEnd(); espLink.sendPacketEnd();

@ -49,8 +49,8 @@ typedef enum {
CMD_REST_REQUEST, CMD_REST_REQUEST,
CMD_REST_SETHEADER, CMD_REST_SETHEADER,
CMD_WEB_JSON_DATA = 30, CMD_WEB_DATA = 30, // MCU pushes data using this command
CMD_WEB_REQ_CB, CMD_WEB_REQ_CB, // esp-link WEB callback
} CmdName; } CmdName;
typedef void (*cmdfunc_t)(CmdPacket *cmd); typedef void (*cmdfunc_t)(CmdPacket *cmd);

@ -48,7 +48,7 @@ const CmdList commands[] = {
{CMD_REST_REQUEST, "REST_REQ", REST_Request}, {CMD_REST_REQUEST, "REST_REQ", REST_Request},
{CMD_REST_SETHEADER, "REST_SETHDR", REST_SetHeader}, {CMD_REST_SETHEADER, "REST_SETHDR", REST_SetHeader},
#endif #endif
{CMD_WEB_JSON_DATA, "WEB_JSON_DATA", WEB_JsonData}, {CMD_WEB_DATA, "WEB_DATA", WEB_Data},
}; };
//===== List of registered callbacks (to uC) //===== List of registered callbacks (to uC)

@ -365,7 +365,7 @@ int ICACHE_FLASH_ATTR WEB_CgiJsonHook(HttpdConnData *connData)
return HTTPD_CGI_MORE; return HTTPD_CGI_MORE;
} }
void ICACHE_FLASH_ATTR WEB_JsonData(CmdPacket *cmd) void ICACHE_FLASH_ATTR WEB_Data(CmdPacket *cmd)
{ {
CmdRequest req; CmdRequest req;
cmdRequest(&req, cmd); cmdRequest(&req, cmd);

@ -31,7 +31,7 @@ void WEB_Init();
char * WEB_UserPages(); char * WEB_UserPages();
int WEB_CgiJsonHook(HttpdConnData *connData); int WEB_CgiJsonHook(HttpdConnData *connData);
void WEB_JsonData(CmdPacket *cmd); void WEB_Data(CmdPacket *cmd);
#endif /* WEB_SERVER_H */ #endif /* WEB_SERVER_H */

Loading…
Cancel
Save