Controls the central heating system and the lights.

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

Committer:
andrewboyson
Date:
Mon May 10 10:23:48 2021 +0000
Revision:
0:22b158d3c76f
Child:
5:3579001bea1b
New version as old one would not commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 0:22b158d3c76f 1 #include <stdint.h>
andrewboyson 0:22b158d3c76f 2 #include <stdio.h>
andrewboyson 0:22b158d3c76f 3
andrewboyson 0:22b158d3c76f 4 #include "http.h"
andrewboyson 0:22b158d3c76f 5 #include "boiler.h"
andrewboyson 0:22b158d3c76f 6 #include "radiator.h"
andrewboyson 0:22b158d3c76f 7 #include "ds18b20.h"
andrewboyson 0:22b158d3c76f 8 #include "program.h"
andrewboyson 0:22b158d3c76f 9 #include "1-wire-device.h"
andrewboyson 0:22b158d3c76f 10
andrewboyson 0:22b158d3c76f 11 void WebRadiatorAjax()
andrewboyson 0:22b158d3c76f 12 {
andrewboyson 0:22b158d3c76f 13 HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL);
andrewboyson 0:22b158d3c76f 14
andrewboyson 0:22b158d3c76f 15 HttpAddInt16AsHex(RadiatorGetHallDS18B20Value()); HttpAddChar('\n');
andrewboyson 0:22b158d3c76f 16
andrewboyson 0:22b158d3c76f 17 int nibble = 0;
andrewboyson 0:22b158d3c76f 18 if (ProgramTimerOutput ) nibble |= 0x01;
andrewboyson 0:22b158d3c76f 19 if (RadiatorGetWinter() ) nibble |= 0x02;
andrewboyson 0:22b158d3c76f 20 if (RadiatorGetOverride()) nibble |= 0x04;
andrewboyson 0:22b158d3c76f 21 if (RadiatorPump ) nibble |= 0x08;
andrewboyson 0:22b158d3c76f 22 HttpAddNibbleAsHex (nibble); HttpAddChar('\n');
andrewboyson 0:22b158d3c76f 23
andrewboyson 0:22b158d3c76f 24 HttpAddByteAsHex (RadiatorGetOverrideCancelHour() ); HttpAddChar('\n');
andrewboyson 0:22b158d3c76f 25 HttpAddByteAsHex (RadiatorGetOverrideCancelMinute()); HttpAddChar('\n');
andrewboyson 0:22b158d3c76f 26 HttpAddInt16AsHex(RadiatorGetNightTemperature() ); HttpAddChar('\n');
andrewboyson 0:22b158d3c76f 27 HttpAddInt16AsHex(RadiatorGetFrostTemperature() ); HttpAddChar('\n');
andrewboyson 0:22b158d3c76f 28 }
andrewboyson 0:22b158d3c76f 29