59 |
59 |
60 |
60 |
61 |
61 |
62 void defaultControlConstants(void) |
62 void defaultControlConstants(void) |
63 { |
63 { |
64 Config.cc_tempFormat = 'C'; |
64 Config.tempFormat = 'C'; |
65 Config.cc_tempSetMin = 1.0; |
65 Config.cc_tempSetMin = 1.0; |
66 Config.cc_tempSetMax = 30.0; |
66 Config.cc_tempSetMax = 30.0; |
67 Config.cc_idleRangeH = 1.000; |
67 Config.cc_idleRangeH = 1.000; |
68 Config.cc_idleRangeL = -1.000; |
68 Config.cc_idleRangeL = -1.000; |
69 } |
69 } |
190 srv_send("%.1f", Config.cs_fridgeSet); |
190 srv_send("%.1f", Config.cs_fridgeSet); |
191 } else if (strncmp(buf, "getBeer", 7) == 0) { |
191 } else if (strncmp(buf, "getBeer", 7) == 0) { |
192 srv_send("%.1f", Config.cs_beerSet); |
192 srv_send("%.1f", Config.cs_beerSet); |
193 } else if (strncmp(buf, "getControlConstants", 19) == 0) { |
193 } else if (strncmp(buf, "getControlConstants", 19) == 0) { |
194 srv_send("{ \"tempFormat\":\"%c\", \"tempSetMin\":%.1f, \"tempSetMax\":%.1f, \"idleRangeH\":%.3f, \"idleRangeL\":%.3f }", |
194 srv_send("{ \"tempFormat\":\"%c\", \"tempSetMin\":%.1f, \"tempSetMax\":%.1f, \"idleRangeH\":%.3f, \"idleRangeL\":%.3f }", |
195 Config.cc_tempFormat, Config.cc_tempSetMin, Config.cc_tempSetMax, Config.cc_idleRangeH, Config.cc_idleRangeL ); |
195 Config.tempFormat, Config.cc_tempSetMin, Config.cc_tempSetMax, Config.cc_idleRangeH, Config.cc_idleRangeL ); |
196 } else if (strncmp(buf, "getControlSettings", 18) == 0) { |
196 } else if (strncmp(buf, "getControlSettings", 18) == 0) { |
197 srv_send("{ \"mode\":\"%c\", \"beerSet\":%.1f, \"fridgeSet\":%.1f, \"heatEstimator\":%.1f, \"coolEstimator\":%.1f }", |
197 srv_send("{ \"mode\":\"%c\", \"beerSet\":%.1f, \"fridgeSet\":%.1f, \"heatEstimator\":%.1f, \"coolEstimator\":%.1f }", |
198 Config.cs_mode, Config.cs_beerSet, Config.cs_fridgeSet, Config.cs_heatEstimator, Config.cs_coolEstimator); |
198 Config.cs_mode, Config.cs_beerSet, Config.cs_fridgeSet, Config.cs_heatEstimator, Config.cs_coolEstimator); |
199 } else if (strncmp(buf, "getControlVariables", 19) == 0) { |
199 } else if (strncmp(buf, "getControlVariables", 19) == 0) { |
200 srv_send("{ \"beerDiff\":%.2f }", cv_beerDiff); |
200 srv_send("{ \"beerDiff\":%.2f }", cv_beerDiff); |