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 Jan 17 13:42:54 2019 +0000
Revision:
24:e3ed1b52c6e6
Child:
25:f73966bd9b43
Updated http-base library

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 "ntp-client.h"
andrewboyson 24:e3ed1b52c6e6 9 #include "values.h"
andrewboyson 24:e3ed1b52c6e6 10 #include "ip4.h"
andrewboyson 24:e3ed1b52c6e6 11 #include "settings.h"
andrewboyson 24:e3ed1b52c6e6 12 #include "clktime.h"
andrewboyson 24:e3ed1b52c6e6 13
andrewboyson 24:e3ed1b52c6e6 14 void HttpSystemQuery(char* pQuery)
andrewboyson 24:e3ed1b52c6e6 15 {
andrewboyson 24:e3ed1b52c6e6 16 while (pQuery)
andrewboyson 24:e3ed1b52c6e6 17 {
andrewboyson 24:e3ed1b52c6e6 18 char* pName;
andrewboyson 24:e3ed1b52c6e6 19 char* pValue;
andrewboyson 24:e3ed1b52c6e6 20 pQuery = HttpSplitQuery(pQuery, &pName, &pValue);
andrewboyson 24:e3ed1b52c6e6 21
andrewboyson 24:e3ed1b52c6e6 22 HttpDecodeValue(pValue);
andrewboyson 24:e3ed1b52c6e6 23
andrewboyson 24:e3ed1b52c6e6 24 int value = (int)strtol(pValue, NULL, 10);
andrewboyson 24:e3ed1b52c6e6 25
andrewboyson 24:e3ed1b52c6e6 26 if (strcmp(pName, "watchdogflagoff") == 0) WatchdogFlag = 0;
andrewboyson 24:e3ed1b52c6e6 27 if (strcmp(pName, "tankrom") == 0)
andrewboyson 24:e3ed1b52c6e6 28 {
andrewboyson 24:e3ed1b52c6e6 29 char rom[8];
andrewboyson 24:e3ed1b52c6e6 30 DeviceParseAddress(pValue, rom);
andrewboyson 24:e3ed1b52c6e6 31 BoilerSetTankRom(rom);
andrewboyson 24:e3ed1b52c6e6 32 }
andrewboyson 24:e3ed1b52c6e6 33 if (strcmp(pName, "boileroutputrom") == 0)
andrewboyson 24:e3ed1b52c6e6 34 {
andrewboyson 24:e3ed1b52c6e6 35 char rom[8];
andrewboyson 24:e3ed1b52c6e6 36 DeviceParseAddress(pValue, rom);
andrewboyson 24:e3ed1b52c6e6 37 BoilerSetOutputRom(rom);
andrewboyson 24:e3ed1b52c6e6 38 }
andrewboyson 24:e3ed1b52c6e6 39 if (strcmp(pName, "boilerreturnrom") == 0)
andrewboyson 24:e3ed1b52c6e6 40 {
andrewboyson 24:e3ed1b52c6e6 41 char rom[8];
andrewboyson 24:e3ed1b52c6e6 42 DeviceParseAddress(pValue, rom);
andrewboyson 24:e3ed1b52c6e6 43 BoilerSetReturnRom(rom);
andrewboyson 24:e3ed1b52c6e6 44 }
andrewboyson 24:e3ed1b52c6e6 45 if (strcmp(pName, "hallrom") == 0)
andrewboyson 24:e3ed1b52c6e6 46 {
andrewboyson 24:e3ed1b52c6e6 47 char rom[8];
andrewboyson 24:e3ed1b52c6e6 48 DeviceParseAddress(pValue, rom);
andrewboyson 24:e3ed1b52c6e6 49 RadiatorSetHallRom(rom);
andrewboyson 24:e3ed1b52c6e6 50 }
andrewboyson 24:e3ed1b52c6e6 51
andrewboyson 24:e3ed1b52c6e6 52 if (strcmp(pName, "onewiretrace" ) == 0) ChgTraceOneWire();
andrewboyson 24:e3ed1b52c6e6 53
andrewboyson 24:e3ed1b52c6e6 54 if (strcmp(pName, "tftpserver" ) == 0) ValuesSetServerName (pValue );
andrewboyson 24:e3ed1b52c6e6 55 if (strcmp(pName, "tftpfilename" ) == 0) ValuesSetFileName (pValue );
andrewboyson 24:e3ed1b52c6e6 56 if (strcmp(pName, "tftpwriteint" ) == 0) ValuesSetWriteSize (value );
andrewboyson 24:e3ed1b52c6e6 57 if (strcmp(pName, "tftpreadint" ) == 0) ValuesSetReadInterval (value );
andrewboyson 24:e3ed1b52c6e6 58
andrewboyson 24:e3ed1b52c6e6 59 if (strcmp(pName, "ntpserver" ) == 0) NtpClientSetServerName (pValue );
andrewboyson 24:e3ed1b52c6e6 60 if (strcmp(pName, "clockinitial" ) == 0) NtpClientSetInitialInterval(value );
andrewboyson 24:e3ed1b52c6e6 61 if (strcmp(pName, "clocknormal" ) == 0) NtpClientSetNormalInterval (value * 60 );
andrewboyson 24:e3ed1b52c6e6 62 if (strcmp(pName, "clockretry" ) == 0) NtpClientSetRetryInterval (value );
andrewboyson 24:e3ed1b52c6e6 63 if (strcmp(pName, "clockoffset" ) == 0) NtpClientSetOffsetMs (value );
andrewboyson 24:e3ed1b52c6e6 64 if (strcmp(pName, "clockmaxdelay" ) == 0) NtpClientSetMaxDelayMs (value );
andrewboyson 24:e3ed1b52c6e6 65
andrewboyson 24:e3ed1b52c6e6 66
andrewboyson 24:e3ed1b52c6e6 67
andrewboyson 24:e3ed1b52c6e6 68 }
andrewboyson 24:e3ed1b52c6e6 69 }