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-radiator-query.c Source File

web-radiator-query.c

00001 #include <string.h>
00002 #include <stdlib.h>
00003 #include "http.h"
00004 #include "radiator.h"
00005 
00006 void WebRadiatorQuery(char* pQuery)
00007 {
00008     while (pQuery)
00009     {
00010         char* pName;
00011         char* pValue;
00012         pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
00013         int value = HttpQueryValueAsInt(pValue);
00014         
00015         if (HttpSameStr(pName, "overridecancelminute"))
00016         {
00017             int hour   = value / 100;
00018             int minute = value % 100;
00019             RadiatorSetOverrideCancelHour  (hour);
00020             RadiatorSetOverrideCancelMinute(minute);
00021         }
00022         
00023         if (HttpSameStr(pName, "htg-chg-mode"        )) RadiatorChgWinter();
00024         if (HttpSameStr(pName, "htg-chg-override"    )) RadiatorChgOverride();
00025         
00026         if (HttpSameStr(pName, "nighttemp"           )) RadiatorSetNightTemperature(value);
00027         if (HttpSameStr(pName, "frosttemp"           )) RadiatorSetFrostTemperature(value);
00028     }
00029 }
00030