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

Committer:
andrewboyson
Date:
Thu Mar 14 16:58:03 2019 +0000
Revision:
39:5d8a37c921c3
Parent:
37:1cdd820f2747
Child:
48:6eac12df3ad5
Libraries updated

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 24:e3ed1b52c6e6 1 #include <string.h>
andrewboyson 24:e3ed1b52c6e6 2 #include <stdlib.h>
andrewboyson 24:e3ed1b52c6e6 3 #include "http.h"
andrewboyson 24:e3ed1b52c6e6 4 #include "watchdog.h"
andrewboyson 24:e3ed1b52c6e6 5 #include "1-wire-device.h"
andrewboyson 24:e3ed1b52c6e6 6 #include "boiler.h"
andrewboyson 24:e3ed1b52c6e6 7 #include "radiator.h"
andrewboyson 24:e3ed1b52c6e6 8 #include "values.h"
andrewboyson 24:e3ed1b52c6e6 9 #include "ip4.h"
andrewboyson 24:e3ed1b52c6e6 10 #include "settings.h"
andrewboyson 24:e3ed1b52c6e6 11 #include "clktime.h"
andrewboyson 24:e3ed1b52c6e6 12
andrewboyson 24:e3ed1b52c6e6 13 void HttpSystemQuery(char* pQuery)
andrewboyson 24:e3ed1b52c6e6 14 {
andrewboyson 24:e3ed1b52c6e6 15 while (pQuery)
andrewboyson 24:e3ed1b52c6e6 16 {
andrewboyson 24:e3ed1b52c6e6 17 char* pName;
andrewboyson 24:e3ed1b52c6e6 18 char* pValue;
andrewboyson 26:85e3becbebc9 19 pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
andrewboyson 24:e3ed1b52c6e6 20
andrewboyson 26:85e3becbebc9 21 HttpQueryUnencode(pValue);
andrewboyson 24:e3ed1b52c6e6 22
andrewboyson 39:5d8a37c921c3 23 int value = HttpQueryValueAsInt(pValue);
andrewboyson 24:e3ed1b52c6e6 24
andrewboyson 25:f73966bd9b43 25 if (HttpSameStr(pName, "watchdogflagoff")) WatchdogFlag = 0;
andrewboyson 25:f73966bd9b43 26 if (HttpSameStr(pName, "tankrom"))
andrewboyson 24:e3ed1b52c6e6 27 {
andrewboyson 24:e3ed1b52c6e6 28 char rom[8];
andrewboyson 24:e3ed1b52c6e6 29 DeviceParseAddress(pValue, rom);
andrewboyson 24:e3ed1b52c6e6 30 BoilerSetTankRom(rom);
andrewboyson 24:e3ed1b52c6e6 31 }
andrewboyson 25:f73966bd9b43 32 if (HttpSameStr(pName, "boileroutputrom"))
andrewboyson 24:e3ed1b52c6e6 33 {
andrewboyson 24:e3ed1b52c6e6 34 char rom[8];
andrewboyson 24:e3ed1b52c6e6 35 DeviceParseAddress(pValue, rom);
andrewboyson 24:e3ed1b52c6e6 36 BoilerSetOutputRom(rom);
andrewboyson 24:e3ed1b52c6e6 37 }
andrewboyson 25:f73966bd9b43 38 if (HttpSameStr(pName, "boilerreturnrom"))
andrewboyson 24:e3ed1b52c6e6 39 {
andrewboyson 24:e3ed1b52c6e6 40 char rom[8];
andrewboyson 24:e3ed1b52c6e6 41 DeviceParseAddress(pValue, rom);
andrewboyson 24:e3ed1b52c6e6 42 BoilerSetReturnRom(rom);
andrewboyson 24:e3ed1b52c6e6 43 }
andrewboyson 25:f73966bd9b43 44 if (HttpSameStr(pName, "hallrom"))
andrewboyson 24:e3ed1b52c6e6 45 {
andrewboyson 24:e3ed1b52c6e6 46 char rom[8];
andrewboyson 24:e3ed1b52c6e6 47 DeviceParseAddress(pValue, rom);
andrewboyson 24:e3ed1b52c6e6 48 RadiatorSetHallRom(rom);
andrewboyson 24:e3ed1b52c6e6 49 }
andrewboyson 24:e3ed1b52c6e6 50
andrewboyson 25:f73966bd9b43 51 if (HttpSameStr(pName, "onewiretrace" )) ChgTraceOneWire();
andrewboyson 24:e3ed1b52c6e6 52
andrewboyson 25:f73966bd9b43 53 if (HttpSameStr(pName, "tftpserver" )) ValuesSetServerName (pValue );
andrewboyson 25:f73966bd9b43 54 if (HttpSameStr(pName, "tftpfilename" )) ValuesSetFileName (pValue );
andrewboyson 25:f73966bd9b43 55 if (HttpSameStr(pName, "tftpwriteint" )) ValuesSetWriteSize (value );
andrewboyson 37:1cdd820f2747 56 if (HttpSameStr(pName, "tftpreadint" )) ValuesSetReadInterval (value );
andrewboyson 24:e3ed1b52c6e6 57 }
andrewboyson 24:e3ed1b52c6e6 58 }