Manages the 1-wire bus
Dependents: oldheating heating
web/web-1wire-query.c@2:79cad6a51fd0, 2019-04-27 (annotated)
- Committer:
- andrewboyson
- Date:
- Sat Apr 27 09:26:15 2019 +0000
- Revision:
- 2:79cad6a51fd0
- Parent:
- http/http-1wire-query.c@1:c272b1fcc834
- Child:
- 10:b4e0b4c4e045
Updated web library
Who changed what in which revision?
User | Revision | Line number | New 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 | 1:c272b1fcc834 | 24 | |
andrewboyson | 1:c272b1fcc834 | 25 | if (HttpSameStr(pName, "onewiretrace" )) ChgTraceOneWire(); |
andrewboyson | 1:c272b1fcc834 | 26 | } |
andrewboyson | 1:c272b1fcc834 | 27 | } |