Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EthernetClient client = server.available();
- if (client) {
- while (client.connected()) {
- if (client.available()) {
- char c = client.read();
- //read char by char HTTP request
- if (readString.length() < 100) {
- //store characters to string
- readString += c;
- //Serial.print(c);
- }
- //Essa funcao IF faz leitura de todos os estados das portas esta maior do que 1
- if (c == '\n') {
- Serial.println(readString);
- //LEITURA DO LIGAEDESLIGATV
- if(readString.indexOf("?Tvligadesliga") >0) {
- //Serial.println("Desliga-Liga TV");
- Serial.print("O");
- //Serial.print("?Tvligadesliga");
- }
- //LEITURA DO SOURCE
- if(readString.indexOf("?Tvsource") >0) {
- //Serial.println("Source");
- Serial.print("Z");
- //Serial.print("?Tvsource");
- }
- //LEITURA DO CANAL+
- if(readString.indexOf("?Tvcanalmais") >0) {
- //Serial.println("Canal+");
- Serial.print("W");
- // Serial.print("?Tvcanalmais");
- }
- //LEITURA DO CANAL-
- if(readString.indexOf("?Tvcanalmenos") >0) {
- //Serial.println("Canal-");
- Serial.print("K");
- //Serial.print("?Tvcanalmenos");
- }
- //LEITURA DO VOLUME+
- if(readString.indexOf("?Tvsommais") >0) {
- //Serial.println("Volume +");
- Serial.print("Y");
- //Serial.print("?Tvsommais");
- }
- //LEITURA DO VOLUME-
- if(readString.indexOf("?Tvsommenos") >0) {
- //Serial.println("Volume -");
- Serial.print("Q");
- //Serial.print("?Tvsommenos");
- }
- //LEITURA DO SOM MUDO
- if(readString.indexOf("?Tvsommudo") >0) {
- //Serial.println("Mudo");
- Serial.print("M");
- //Serial.print("?Tvsommudo");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement