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/system/http-system-query.c

Committer:
andrewboyson
Date:
2019-01-25
Revision:
28:bb55def47737
Parent:
26:85e3becbebc9
Child:
37:1cdd820f2747

File content as of revision 28:bb55def47737:

#include <string.h>
#include <stdlib.h>
#include "http.h"
#include "watchdog.h"
#include "1-wire-device.h"
#include "boiler.h"
#include "radiator.h"
#include "values.h"
#include "ip4.h"
#include "settings.h"
#include "clktime.h"

void HttpSystemQuery(char* pQuery)
{
    while (pQuery)
    {
        char* pName;
        char* pValue;
        pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
        
        HttpQueryUnencode(pValue);

        int value = (int)strtol(pValue, NULL, 10);
                    
        if (HttpSameStr(pName, "watchdogflagoff")) WatchdogFlag = 0;
        if (HttpSameStr(pName, "tankrom"))
        {
            char rom[8];
            DeviceParseAddress(pValue, rom);
            BoilerSetTankRom(rom);
        }
        if (HttpSameStr(pName, "boileroutputrom"))
        {
            char rom[8];
            DeviceParseAddress(pValue, rom);
            BoilerSetOutputRom(rom);
        }
        if (HttpSameStr(pName, "boilerreturnrom"))
        {
            char rom[8];
            DeviceParseAddress(pValue, rom);
            BoilerSetReturnRom(rom);
        }
        if (HttpSameStr(pName, "hallrom"))
        {
            char rom[8];
            DeviceParseAddress(pValue, rom);
            RadiatorSetHallRom(rom);
        }
        
        if (HttpSameStr(pName, "onewiretrace"  )) ChgTraceOneWire();

        if (HttpSameStr(pName, "tftpserver"    )) ValuesSetServerName        (pValue          );
        if (HttpSameStr(pName, "tftpfilename"  )) ValuesSetFileName          (pValue          );
        if (HttpSameStr(pName, "tftpwriteint"  )) ValuesSetWriteSize         (value           );
        if (HttpSameStr(pName, "tftpreadint"   )) ValuesSetReadInterval      (value           );

        if (HttpSameStr(pName, "ntpserver"     )) SetNtpClientServerName     (pValue          );
        if (HttpSameStr(pName, "clockinitial"  )) SetNtpClientInitialInterval(value           );
        if (HttpSameStr(pName, "clocknormal"   )) SetNtpClientNormalInterval (value *      60 );
        if (HttpSameStr(pName, "clockretry"    )) SetNtpClientRetryInterval  (value           );
        if (HttpSameStr(pName, "clockoffset"   )) SetNtpClientOffsetMs       (value           );
        if (HttpSameStr(pName, "clockmaxdelay" )) SetNtpClientMaxDelayMs     (value           );
        

        
    }
}