teste de publish

Dependencies:   DS1820 HighSpeedAnalogIn devices mbed

Revision:
15:0f78bf9c13ec
Parent:
14:c0162ab2a951
Child:
17:9b0eecbacbaa
--- a/main.cpp	Thu Nov 09 12:53:41 2017 +0000
+++ b/main.cpp	Wed Dec 27 13:10:09 2017 +0000
@@ -219,12 +219,7 @@
     while(true){                
         osSignalWait(0x1,500); //Executo compulsoriamente mesmo que não haja sinal num periodo de meio segundo        
         //pc.printf("Thread: COM.\r\n");
-        //if((modemCom::status.SRING)&&(!modemCom::status.serverConnected)){
-    
-        if(modemCom::status.SRINGsockEntrante){
-            modemCom::status.SRINGsockEntrante=false;
-            modemCom::atendeSRING(modemCom::status.connIDServerCommand);     
-        }
+        //if((modemCom::status.SRING)&&(!modemCom::status.serverConnected)){        
         
         if(inicializaModemBool){
             inicializaModemBool = false;
@@ -266,7 +261,13 @@
             }else{
                 pc.printf("Erro enviando o arquivo <%s>.\n",arquivoEnvioPointer->nome);
              }            
-        }        
+        }
+        
+        if(modemCom::status.SRINGsockEntrante){
+            modemCom::status.SRINGsockEntrante=false;
+            modemCom::atendeSRING(modemCom::status.connIDServerCommand);     
+        }
+                
         modemCom::timeOutModem = 30;    
     }    
 }
@@ -410,7 +411,7 @@
             if(eventosRTC::minutos){
                 //Executo abaixo a rotina de 1 minuto
                 writeReadingsToSD();
-                if(!modemCom::status.emComunicacao){modemCom::verificaConexao();}
+                //if(!modemCom::status.emComunicacao){modemCom::verificaConexao();}
                 eventosRTC::minutos = false;
             }
             
@@ -454,14 +455,15 @@
         
         if(executaComandoServer){
             executaComandoServer = false;
-            commands::exec(modemCom::status.connIDServerCommand);   
+            commands::exec(modemCom::status.connIDServerCommand);
+            modemCom::closeConnection(modemCom::status.connIDServerCommand);
         }        
     
         if(modemCom::atendendoWebServer){                
                 modemCom::atendendoWebServer = false;
-                pc.printf("Atendendo webServer.\r\n");
+                pc.printf("Atendendo webServer na conexao %u.\r\n",modemCom::status.connIDWebServer);
                 modemCom::status.emComunicacao=true;
-                modemCom::webServer();                
+                modemCom::webServer(modemCom::status.connIDWebServer);                
                 modemCom::status.emComunicacao=false;
         }