
Controls the central heating system and the lights.
Dependencies: 1-wire clock crypto fram log lpc1768 net web wiz mbed
web-this/radiator/web-radiator-query.c@8:8ac076ce51af, 2022-11-12 (annotated)
- Committer:
- andrewboyson
- Date:
- Sat Nov 12 10:03:38 2022 +0000
- Revision:
- 8:8ac076ce51af
- Parent:
- 5:3579001bea1b
Updated LPC1768 library
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 0:22b158d3c76f | 1 | #include <string.h> |
andrewboyson | 0:22b158d3c76f | 2 | #include <stdlib.h> |
andrewboyson | 0:22b158d3c76f | 3 | #include "http.h" |
andrewboyson | 0:22b158d3c76f | 4 | #include "radiator.h" |
andrewboyson | 0:22b158d3c76f | 5 | |
andrewboyson | 0:22b158d3c76f | 6 | void WebRadiatorQuery(char* pQuery) |
andrewboyson | 0:22b158d3c76f | 7 | { |
andrewboyson | 0:22b158d3c76f | 8 | while (pQuery) |
andrewboyson | 0:22b158d3c76f | 9 | { |
andrewboyson | 0:22b158d3c76f | 10 | char* pName; |
andrewboyson | 0:22b158d3c76f | 11 | char* pValue; |
andrewboyson | 0:22b158d3c76f | 12 | pQuery = HttpQuerySplit(pQuery, &pName, &pValue); |
andrewboyson | 0:22b158d3c76f | 13 | int value = HttpQueryValueAsInt(pValue); |
andrewboyson | 0:22b158d3c76f | 14 | |
andrewboyson | 0:22b158d3c76f | 15 | if (HttpSameStr(pName, "overridecancelminute")) |
andrewboyson | 0:22b158d3c76f | 16 | { |
andrewboyson | 0:22b158d3c76f | 17 | int hour = value / 100; |
andrewboyson | 0:22b158d3c76f | 18 | int minute = value % 100; |
andrewboyson | 0:22b158d3c76f | 19 | RadiatorSetOverrideCancelHour (hour); |
andrewboyson | 0:22b158d3c76f | 20 | RadiatorSetOverrideCancelMinute(minute); |
andrewboyson | 0:22b158d3c76f | 21 | } |
andrewboyson | 0:22b158d3c76f | 22 | |
andrewboyson | 0:22b158d3c76f | 23 | if (HttpSameStr(pName, "htg-chg-mode" )) RadiatorChgWinter(); |
andrewboyson | 0:22b158d3c76f | 24 | if (HttpSameStr(pName, "htg-chg-override" )) RadiatorChgOverride(); |
andrewboyson | 5:3579001bea1b | 25 | if (HttpSameStr(pName, "htg-chg-hw-prot" )) RadiatorChgHotWaterProtectOn(); |
andrewboyson | 0:22b158d3c76f | 26 | |
andrewboyson | 0:22b158d3c76f | 27 | if (HttpSameStr(pName, "nighttemp" )) RadiatorSetNightTemperature(value); |
andrewboyson | 0:22b158d3c76f | 28 | if (HttpSameStr(pName, "frosttemp" )) RadiatorSetFrostTemperature(value); |
andrewboyson | 5:3579001bea1b | 29 | if (HttpSameStr(pName, "hwprotecttemp" )) RadiatorSetHotWaterProtectTemp(value); |
andrewboyson | 0:22b158d3c76f | 30 | } |
andrewboyson | 0:22b158d3c76f | 31 | } |
andrewboyson | 0:22b158d3c76f | 32 |