teste de publish

Dependencies:   DS1820 HighSpeedAnalogIn devices mbed

Revision:
22:cb832a9bc704
Parent:
21:b9315cdd9275
Child:
23:f3c87afb6548
--- a/modem.cpp	Tue Feb 06 16:33:51 2018 +0000
+++ b/modem.cpp	Tue Feb 06 22:07:10 2018 +0000
@@ -18,6 +18,7 @@
             
             if(modemCom::status.emComunicacao){
                 modemCom::cipSend(conId,"ocupado",7);
+                pc.printf("Fechando socket chave 1.\r\n");
                 modemCom::closeConnection(conId);
             }
             
@@ -40,7 +41,8 @@
             modemCom::status.serverConnected=0;
             modemCom::timeOutModem = 10;            
                         
-            //Fechando o socket                        
+            //Fechando o socket         
+            pc.printf("Fechando socket chave 2.\r\n");               
             modemCom::closeConnection(conId);
             modemCom::status.socketEntranteAtivo=false;
             modemCom::status.emComunicacao = false;
@@ -457,7 +459,7 @@
             #ifdef xereta_modem
                 pc.printf("> maxTentativas = %lu.\n",maxTentativas);
             #endif
-        }    
+        }else{return 1;}
         maxTentativas--;
         osDelay(delayEntreTentativas);    
     }    
@@ -626,7 +628,7 @@
             printf("Requisicao nao enviada 3!!\n");
         }         
     }    
-    
+    pc.printf("Fechando socket chave 3.\r\n");
     modemCom::closeConnection(id);    
     if(mudaRede){            
         mudaRede = false;
@@ -826,7 +828,7 @@
     }     
     
     if(IPDNumBytes && modemCom::status.recebendoArquivoDoServer && (strstr(modemCom::bufIn,"CONNECT")==NULL) && (strstr(modemCom::bufIn,"*ServerCommand*")==NULL) ){
-
+        pc.printf("sendData recebidos %lu bytes\n",sdCard::nBytesArquivoRecebidos/2);
         sdCard::insereDadosArquivoHex(&sdCard::tempFile,modemCom::bufIn,IPDNumBytes);
         //sdCard::insereDadosArquivo(&sdCard::tempFile,modemCom::bufIn,IPDNumBytes);
         sdCard::nBytesArquivoRecebidos+=IPDNumBytes;
@@ -839,8 +841,8 @@
             timeOut--;
         }
         modemCom::status.timeOut = 30;
-        modem.puts("sendData\r\n");
-        pc.printf("sendData recebidos %lu bytes\n",sdCard::nBytesArquivoRecebidos/2);
+        
+        modem.puts("sendData\r\n");        
         diversos::wdt.kick();
         return;
     }