2/2 del código
switch (on_off1) {
case 1:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 1: <font color=\"#00FF00\">On</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=3>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch off\"></form>"));
break;
case 0:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 1: <font color=\"#CC0000\">Off</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=2>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch on\"></form>"));
break;
}
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("</td><td align=center>"));
switch (on_off2) {
case 1:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 2: <font color=\"#00FF00\">On</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=5>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch off\"></form>"));
break;
case 0:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 2: <font color=\"#CC0000\">Off</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=4>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch on\"></form>"));
break;
}
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("</td></tr><tr><td align=center>"));
switch (on_off3) {
case 1:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 3: <font color=\"#00FF00\">On</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=7>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch off\"></form>"));
break;
case 0:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 3: <font color=\"#CC0000\">Off</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=6>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch on\"></form>"));
break;
}
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("</td><td align=center>"));
switch (on_off4) {
case 1:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 4: <font color=\"#00FF00\">On</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=9>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch off\"></form>"));
break;
case 0:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 4: <font color=\"#CC0000\">Off</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=8>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch on\"></form>"));
break;
}
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("</td></tr><tr><td align=center>"));
switch (on_off5) {
case 1:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 5: <font color=\"#00FF00\">On</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=11>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch off\"></form>"));
break;
case 0:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 5: <font color=\"#CC0000\">Off</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=10>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch on\"></form>"));
break;
}
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("</td><td align=center>"));
switch (on_off6) {
case 1:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 6: <font color=\"#00FF00\">On</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=13>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch off\"></form>"));
break;
case 0:
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("Out 6: <font color=\"#CC0000\">Off</font>
"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<form METHOD=get action=\""));
plen=es.ES_fill_tcp_data(buf,plen,baseurl);
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("\">"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=hidden name=cmd value=12>"));
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("<input type=submit value=\"Switch on\"></form>"));
break;
}
plen=es.ES_fill_tcp_data_p(buf,plen,PSTR("</td></tr></table></center><hr>Ethernet Shield Arduino 1.0"));
return(plen);
}