Andrew Boyson / Mbed 2 deprecated heating

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

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         if (HttpSameStr(pName, "htg-chg-hw-prot"     )) RadiatorChgHotWaterProtectOn();
00026         
00027         if (HttpSameStr(pName, "nighttemp"           )) RadiatorSetNightTemperature(value);
00028         if (HttpSameStr(pName, "frosttemp"           )) RadiatorSetFrostTemperature(value);
00029         if (HttpSameStr(pName, "hwprotecttemp"       )) RadiatorSetHotWaterProtectTemp(value);
00030     }
00031 }
00032