Central Heating controller using the real time clock, PHY module for internet, 1-wire interface for temperature sensors, a system log and a configuration file

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

/media/uploads/andrewboyson/heating.sch

/media/uploads/andrewboyson/heating.brd

/media/uploads/andrewboyson/eagle.epf

web-this/radiator/web-radiator-ajax.c

Committer:
andrewboyson
Date:
2021-04-23
Revision:
106:41ed3ea0bbba
Parent:
96:18a3813bb4b5

File content as of revision 106:41ed3ea0bbba:

#include  <stdint.h>
#include   <stdio.h>

#include "http.h"
#include "boiler.h"
#include "radiator.h"
#include "ds18b20.h"
#include "program.h"
#include "1-wire-device.h"

void WebRadiatorAjax()
{
    HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL);
                        
    HttpAddInt16AsHex(RadiatorGetHallDS18B20Value()); HttpAddChar('\n');
    
    int nibble = 0;
    if (ProgramTimerOutput   ) nibble |= 0x01;
    if (RadiatorGetWinter()  ) nibble |= 0x02;
    if (RadiatorGetOverride()) nibble |= 0x04;
    if (RadiatorPump         ) nibble |= 0x08;
    HttpAddNibbleAsHex (nibble); HttpAddChar('\n');
    
    HttpAddByteAsHex (RadiatorGetOverrideCancelHour()  ); HttpAddChar('\n');
    HttpAddByteAsHex (RadiatorGetOverrideCancelMinute()); HttpAddChar('\n');
    HttpAddInt16AsHex(RadiatorGetNightTemperature()    ); HttpAddChar('\n');
    HttpAddInt16AsHex(RadiatorGetFrostTemperature()    ); HttpAddChar('\n');
}