Gateway con agregar controles mediante firebase migracion a OS5

Dependencies:   mbed-http ESP01 Pulse RFDecoder

Revision:
2:bc3973471585
Parent:
1:cf6a75de25ce
Child:
3:5dceee1c49fc
--- a/main.cpp	Sat May 25 04:59:06 2019 +0000
+++ b/main.cpp	Sat May 25 18:08:19 2019 +0000
@@ -3,7 +3,6 @@
 #include "ESP01.h"
 #include "https_request.h"
 #include "mbed_trace.h"
-//#include "network-helper.h"
 #include "TCPSocket.h"
 #include "ESP8266Interface.h"
  
@@ -114,11 +113,23 @@
     wifiInit();
     wifiConnect();
     
+    
+    
     //NextToDo: Crear un servidor y a la vez hacer get y post
     
     ESP8266Interface net(PTC17, PTC16);     //Con este objeto implementamos todas las funciones de red para la creacion de Sockets
+    
     http_demo(&net);
     
+    wifi.StartServerMode(333);
+    wifi.RcvReply(rcv, 1000);
+    pc.printf("%s", rcv);
+    wait(20);
+    
+    http_demo(&net);
+    
+    
+    
     
 
     while(1);
@@ -131,7 +142,7 @@
     wait(2);
     wifi.DisableEcho();
     pc.printf("Set mode to Station+AP\r\n");
-    wifi.SetMode(3);
+    wifi.SetMode(BOTH);
     wifi.RcvReply(rcv, 1000);
     pc.printf("%s", rcv);
     wait(2);
@@ -177,7 +188,7 @@
 
 bool isConnectedToWifi(void){
     bool status;
-    wifi.GetConnStatus(rcv);
+    wifi.GetConnStatusCode(rcv);
     //pc.printf("%s", rcv);
     if(strcmp(rcv,"STATUS:2\r")==0){
         led_azul = OFF;