Manages the 1-wire bus

Dependents:   oldheating heating

Committer:
andrewboyson
Date:
Thu Feb 18 16:47:12 2021 +0000
Revision:
11:3859fee99d5d
Parent:
10:b4e0b4c4e045
Added 'value not set' to the list of possible values.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
andrewboyson 1:c272b1fcc834 1 #include <string.h>
andrewboyson 1:c272b1fcc834 2 #include <stdlib.h>
andrewboyson 1:c272b1fcc834 3 #include "http.h"
andrewboyson 1:c272b1fcc834 4 #include "1-wire-device.h"
andrewboyson 1:c272b1fcc834 5 #include "settings.h"
andrewboyson 1:c272b1fcc834 6 #include "ds18b20.h"
andrewboyson 1:c272b1fcc834 7
andrewboyson 2:79cad6a51fd0 8 void WebOneWireQuery(char* pQuery)
andrewboyson 1:c272b1fcc834 9 {
andrewboyson 1:c272b1fcc834 10 while (pQuery)
andrewboyson 1:c272b1fcc834 11 {
andrewboyson 1:c272b1fcc834 12 char* pName;
andrewboyson 1:c272b1fcc834 13 char* pValue;
andrewboyson 1:c272b1fcc834 14 pQuery = HttpQuerySplit(pQuery, &pName, &pValue);
andrewboyson 1:c272b1fcc834 15
andrewboyson 1:c272b1fcc834 16 HttpQueryUnencode(pValue);
andrewboyson 1:c272b1fcc834 17
andrewboyson 1:c272b1fcc834 18 int value = HttpQueryValueAsInt(pValue);
andrewboyson 1:c272b1fcc834 19
andrewboyson 1:c272b1fcc834 20 if (HttpSameStr(pName, "rom0")) { char rom[8]; DeviceParseAddress(pValue, rom); DS18B20RomSetters[0](rom); }
andrewboyson 1:c272b1fcc834 21 if (HttpSameStr(pName, "rom1")) { char rom[8]; DeviceParseAddress(pValue, rom); DS18B20RomSetters[1](rom); }
andrewboyson 1:c272b1fcc834 22 if (HttpSameStr(pName, "rom2")) { char rom[8]; DeviceParseAddress(pValue, rom); DS18B20RomSetters[2](rom); }
andrewboyson 1:c272b1fcc834 23 if (HttpSameStr(pName, "rom3")) { char rom[8]; DeviceParseAddress(pValue, rom); DS18B20RomSetters[3](rom); }
andrewboyson 10:b4e0b4c4e045 24 if (HttpSameStr(pName, "rom4")) { char rom[8]; DeviceParseAddress(pValue, rom); DS18B20RomSetters[4](rom); }
andrewboyson 10:b4e0b4c4e045 25 if (HttpSameStr(pName, "rom5")) { char rom[8]; DeviceParseAddress(pValue, rom); DS18B20RomSetters[5](rom); }
andrewboyson 10:b4e0b4c4e045 26 if (HttpSameStr(pName, "rom6")) { char rom[8]; DeviceParseAddress(pValue, rom); DS18B20RomSetters[6](rom); }
andrewboyson 10:b4e0b4c4e045 27 if (HttpSameStr(pName, "rom7")) { char rom[8]; DeviceParseAddress(pValue, rom); DS18B20RomSetters[7](rom); }
andrewboyson 1:c272b1fcc834 28
andrewboyson 1:c272b1fcc834 29 if (HttpSameStr(pName, "onewiretrace" )) ChgTraceOneWire();
andrewboyson 1:c272b1fcc834 30 }
andrewboyson 1:c272b1fcc834 31 }