Andrew Boyson / oldheating

Dependencies:   net 1-wire lpc1768 crypto clock web fram log

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers web-system-query.c Source File

web-system-query.c

00001 #include <string.h>
00002 #include <stdlib.h>
00003 
00004 #include "http.h"
00005 #include "watchdog.h"
00006 #include "1-wire-device.h"
00007 #include "boiler.h"
00008 #include "radiator.h"
00009 #include "values.h"
00010 #include "ip4.h"
00011 #include "settings.h"
00012 #include "clktime.h"
00013 
00014 void WebSystemQuery(char* pQuery)
00015 {
00016     while (pQuery)
00017     {
00018         char* pName;
00019         char* pValue;
00020         pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
00021         
00022         HttpQueryUnencode(pValue);
00023 
00024         int value = HttpQueryValueAsInt(pValue);
00025 
00026         if (HttpSameStr(pName, "tftpserver"    )) ValuesSetServerName        (pValue          );
00027         if (HttpSameStr(pName, "tftpfilename"  )) ValuesSetFileName          (pValue          );
00028         if (HttpSameStr(pName, "tftpwriteint"  )) ValuesSetWriteSize         (value           );
00029         if (HttpSameStr(pName, "tftpreadint"   )) ValuesSetReadInterval      (value           );        
00030     }
00031 }