Controls the central heating system and the lights.

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

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers web-boiler-ajax.c Source File

web-boiler-ajax.c

00001 #include  <stdint.h>
00002 #include   <stdio.h>
00003 
00004 #include "http.h"
00005 #include "boiler.h"
00006 #include "radiator.h"
00007 #include "ds18b20.h"
00008 #include "program.h"
00009 #include "1-wire-device.h"
00010 
00011 void WebBoilerAjax()
00012 {
00013     HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL);
00014 
00015     HttpAddInt16AsHex(BoilerGetTankDS18B20Value()  ); HttpAddChar('\n');
00016     HttpAddInt16AsHex(BoilerGetOutputDS18B20Value()); HttpAddChar('\n');
00017     HttpAddInt16AsHex(BoilerGetReturnDS18B20Value()); HttpAddChar('\n');
00018     HttpAddInt16AsHex(BoilerGetRtnDelDS18B20Value()); HttpAddChar('\n');
00019     HttpAddInt16AsHex(BoilerGetDeltaTDS18B20Value()); HttpAddChar('\n');
00020     
00021     int nibble = 0;
00022     if (BoilerCall           ) nibble |= 1;
00023     if (BoilerPump           ) nibble |= 2;
00024     if (BoilerCallEnable     ) nibble |= 4;
00025     HttpAddNibbleAsHex (nibble); HttpAddChar('\n');
00026     
00027     HttpAddInt16AsHex(BoilerGetFullSpeedSecs     ()); HttpAddChar('\n');
00028     HttpAddInt16AsHex(BoilerGetTankSetPoint      ()); HttpAddChar('\n');
00029     HttpAddInt16AsHex(BoilerGetTankHysteresis    ()); HttpAddChar('\n');
00030     HttpAddInt16AsHex(BoilerGetRunOnDeltaT       ()); HttpAddChar('\n');
00031     HttpAddInt16AsHex(BoilerGetRunOnTime         ()); HttpAddChar('\n');
00032     HttpAddInt16AsHex(BoilerPumpSpeed);               HttpAddChar('\n');
00033     HttpAddInt16AsHex(BoilerPumpPwm);                 HttpAddChar('\n');
00034     HttpAddInt16AsHex(BoilerGetPumpSpeedCalling  ()); HttpAddChar('\n');
00035     HttpAddInt16AsHex(BoilerGetRampDownTime      ()); HttpAddChar('\n');
00036     HttpAddByteAsHex (BoilerGetOutputTarget      ()); HttpAddChar('\n');
00037     HttpAddInt16AsHex(BoilerGetMinSpeed          ()); HttpAddChar('\n');
00038     HttpAddInt16AsHex(BoilerGetMidSpeedPwm       ()); HttpAddChar('\n');
00039     HttpAddInt16AsHex(BoilerGetFullSpeedDeltaT   ()); HttpAddChar('\n');
00040 }
00041