Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 1-wire clock crypto fram log lpc1768 net web wiz mbed
web-radiator-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 WebRadiatorAjax() 00012 { 00013 HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL); 00014 00015 HttpAddInt16AsHex(RadiatorGetHallDS18B20Value()); HttpAddChar('\n'); 00016 HttpAddInt16AsHex(BoilerGetTankDS18B20Value() ); HttpAddChar('\n'); 00017 00018 int byte = 0; 00019 if (ProgramTimerOutput ) byte |= 0x01; 00020 if (RadiatorGetWinter() ) byte |= 0x02; 00021 if (RadiatorGetOverride() ) byte |= 0x04; 00022 if (RadiatorPump ) byte |= 0x08; 00023 if (RadiatorGetHotWaterProtectOn()) byte |= 0x10; 00024 if (RadiatorsOn ) byte |= 0x20; 00025 HttpAddByteAsHex(byte); HttpAddChar('\n'); 00026 00027 HttpAddByteAsHex (RadiatorGetOverrideCancelHour() ); HttpAddChar('\n'); 00028 HttpAddByteAsHex (RadiatorGetOverrideCancelMinute()); HttpAddChar('\n'); 00029 HttpAddInt16AsHex(RadiatorGetNightTemperature() ); HttpAddChar('\n'); 00030 HttpAddInt16AsHex(RadiatorGetFrostTemperature() ); HttpAddChar('\n'); 00031 HttpAddByteAsHex (RadiatorGetHotWaterProtectTemp() ); HttpAddChar('\n'); 00032 } 00033
Generated on Sat Nov 12 2022 10:03:51 by
1.7.2