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/boiler/web-boiler-query.c

Committer:
andrewboyson
Date:
2021-02-10
Revision:
104:46ce1aaf8be7
Parent:
91:8b192efd0288
Child:
105:1899f7ed17ec

File content as of revision 104:46ce1aaf8be7:

#include <stdlib.h>
#include <string.h>
#include "http.h"
#include "boiler.h"

void WebBoilerQuery(char* pQuery)
{
    while (pQuery)
    {
        char* pName;
        char* pValue;
        pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
                    
        if (HttpSameStr(pName, "tanksetpoint"  ))
        {
            int value = HttpQueryValueAsInt(pValue);
            BoilerSetTankSetPoint(value);
            return;
        }
        if (HttpSameStr(pName, "tankhysteresis"))
        {
            int value = HttpQueryValueAsInt(pValue);
            BoilerSetTankHysteresis(value);
            return;
        }
        if (HttpSameStr(pName, "boilerresidual"))
        {
            double value = HttpQueryValueAsDouble(pValue);
            BoilerSetRunOnResidual16ths((int)(value * 16));
            return;
        }
        if (HttpSameStr(pName, "boilerrunon"   ))
        {
            int value = HttpQueryValueAsInt(pValue);
            BoilerSetRunOnTime(value);
            return;
        }
        if (HttpSameStr(pName, "pumpspeedcalling"))
        {
            int value = HttpQueryValueAsInt(pValue);
            BoilerSetPumpSpeedCalling(value);
            return;
        }
        if (HttpSameStr(pName, "pumpspeedrunon"))
        {
            int value = HttpQueryValueAsInt(pValue);
            BoilerSetPumpSpeedRunOn(value);
            return;
        }
        if (HttpSameStr(pName, "boileroutputtarget"))
        {
            int value = HttpQueryValueAsInt(pValue);
            BoilerSetOutputTarget(value);
            return;
        }
        if (HttpSameStr(pName, "blrriseat0"))
        {
            double value = HttpQueryValueAsDouble(pValue);
            BoilerSetRise16thsAt0((int)(value * 16));
            return;
        }
        if (HttpSameStr(pName, "blrriseat50"))
        {
            double value = HttpQueryValueAsDouble(pValue);
            BoilerSetRise16thsAt50((int)(value * 16));
            return;
        }
        if (HttpSameStr(pName, "blrriseat100"))
        {
            double value = HttpQueryValueAsDouble(pValue);
            BoilerSetRise16thsAt100((int)(value * 16));
            return;
        }
    }
}