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

http-derived/program/http-program-ajax.c

Committer:
andrewboyson
Date:
2019-04-23
Revision:
47:229338b3adcb
Child:
48:6eac12df3ad5

File content as of revision 47:229338b3adcb:

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

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

void HttpProgramAjax()
{
    HttpOk("text/plain; charset=UTF-8", "no-cache", NULL, NULL);
    
    HttpAddNibbleAsHex (ProgramTimerOutput); HttpAddChar('\n');
    
    const int PROGRAM_CHARACTER_LENGTH = 30;
    char value[PROGRAM_CHARACTER_LENGTH];
    ProgramToString(0, PROGRAM_CHARACTER_LENGTH, value); HttpAddText(value); HttpAddChar('\n');
    ProgramToString(1, PROGRAM_CHARACTER_LENGTH, value); HttpAddText(value); HttpAddChar('\n');
    ProgramToString(2, PROGRAM_CHARACTER_LENGTH, value); HttpAddText(value); HttpAddChar('\n');
    
    HttpAddNibbleAsHex(ProgramGetDay(1) + 1); HttpAddChar('\n');
    HttpAddNibbleAsHex(ProgramGetDay(2) + 1); HttpAddChar('\n');
    HttpAddNibbleAsHex(ProgramGetDay(3) + 1); HttpAddChar('\n');
    HttpAddNibbleAsHex(ProgramGetDay(4) + 1); HttpAddChar('\n');
    HttpAddNibbleAsHex(ProgramGetDay(5) + 1); HttpAddChar('\n');
    HttpAddNibbleAsHex(ProgramGetDay(6) + 1); HttpAddChar('\n');
    HttpAddNibbleAsHex(ProgramGetDay(0) + 1); HttpAddChar('\n');
    
    HttpAddByteAsHex  (ProgramGetNewDayHour()); HttpAddChar('\n');
}