Skip to content

Instantly share code, notes, and snippets.

@exiva
Created June 30, 2012 03:17
Show Gist options
  • Save exiva/3022011 to your computer and use it in GitHub Desktop.
Save exiva/3022011 to your computer and use it in GitHub Desktop.
------------
values
Raw code: 35 //should be 9050,5043,4334
Raw len: 35 //right value
------------
char *rawCode;
int rawLen;
void codeCmd(WebServer &server, WebServer::ConnectionType type, char *url_tail, bool tail_complete) {
char name[NAMELEN];
char value[VALUELEN];
server.httpSuccess();
if (type == WebServer::POST) {
server.readPOSTparam(name, NAMELEN, value, VALUELEN);
if(strcmp(name,"type") == 0) {
if(strcmp(value,"raw") == 0) {
server.readPOSTparam(name, NAMELEN, value, VALUELEN);
if(strcmp(name,"code") == 0) {
rawCode = value; //should be 9050,5043,4334
}
server.readPOSTparam(name, NAMELEN, value, VALUELEN);
if(strcmp(name,"len") == 0) {
rawLen = atoi(value); //should be 35
}
}
server.print("------------\n"); //debugging
server.print("values\n");
server.print("Raw code: ");
server.print(rawCode);
server.print("\n");
server.print("Raw len: ");
server.print(rawLen);
server.print("\n------------\n");
server.print("\n");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment