2016-11-19 19:39:17 +01:00
|
|
|
void notify(int callMode)
|
|
|
|
{
|
|
|
|
switch (callMode)
|
|
|
|
{
|
|
|
|
case 1: if (!notifyDirect) return; break;
|
|
|
|
case 2: if (!notifyButton) return; break;
|
|
|
|
case 3: if (!notifyForward) return; break;
|
2016-11-26 19:34:05 +01:00
|
|
|
case 4: if (!notifyNightlight) return; break;
|
2016-11-19 19:39:17 +01:00
|
|
|
default: return;
|
|
|
|
}
|
2016-11-20 00:07:04 +01:00
|
|
|
String snd = "/ajax_inputs&N=1&A=";
|
2016-11-19 19:39:17 +01:00
|
|
|
snd = snd + bri;
|
|
|
|
snd = snd + "&R=";
|
|
|
|
snd = snd + col[0];
|
|
|
|
snd = snd + "&G=";
|
|
|
|
snd = snd + col[1];
|
|
|
|
snd = snd + "&B=";
|
|
|
|
snd = snd + col[2];
|
2016-11-20 00:07:04 +01:00
|
|
|
//snd = snd + " HTTP/1.1";
|
2016-11-19 19:39:17 +01:00
|
|
|
|
2016-11-20 00:07:04 +01:00
|
|
|
WiFiClient hclient;
|
|
|
|
hclient.setTimeout(50);
|
2016-11-19 19:39:17 +01:00
|
|
|
|
|
|
|
for (int i = 0; i < notifier_ips_count; i++)
|
|
|
|
{
|
2016-11-20 00:07:04 +01:00
|
|
|
|
|
|
|
Serial.println("NCON...");
|
|
|
|
if (hclient.connect(notifier_ips[i].c_str(), 80))
|
|
|
|
{
|
|
|
|
Serial.println("CON!");
|
|
|
|
Serial.println(snd);
|
|
|
|
hclient.print(String("GET ") + snd + " HTTP/1.1\r\n" +
|
|
|
|
"Host: " + notifier_ips[i] + "\r\n" +
|
|
|
|
"Connection: close\r\n\r\n");
|
|
|
|
|
|
|
|
} else
|
|
|
|
{
|
|
|
|
Serial.println("NO CONNECTION");
|
|
|
|
hclient.stop();
|
|
|
|
}
|
2016-11-19 19:39:17 +01:00
|
|
|
}
|
|
|
|
}
|