For test

Dependencies:   mbed

Revision:
20:43451f36281e
Parent:
18:37254b357abd
Child:
23:4cec7b9e3715
diff -r 6c8b29734511 -r 43451f36281e ESP8266.cpp
--- a/ESP8266.cpp	Wed Feb 04 09:28:28 2015 +0000
+++ b/ESP8266.cpp	Wed Feb 04 09:39:10 2015 +0000
@@ -144,7 +144,7 @@
         
         unsigned long start;
         start = millis();
-        char c0 = esp_uart.read_char();
+        char c0 = esp_uart.readChr();
         if (c0 == '+')
         {
             
@@ -152,7 +152,7 @@
             {
                 if (esp_uart.available()>0)
                 {
-                    char c = esp_uart.read_char();
+                    char c = esp_uart.readChr();
                     data += c;
                 }
                 if (data.indexOf("\nOK")!=-1)
@@ -260,7 +260,7 @@
     while (millis()-start<2000) {
      if(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("OK")!=-1)
@@ -308,7 +308,7 @@
     while (millis()-start<2000) {
       if(esp_uart.available()>0)
       {
-      char mode =esp_uart.read_char();
+      char mode =esp_uart.readChr();
       data=data+mode;
       }
       if (data.indexOf("OK")!=-1 || data.indexOf("no change")!=-1)
@@ -346,7 +346,7 @@
     while (millis()-start<8000) {
    if(esp_uart.available()>0)
    {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
    }
      if (data.indexOf("OK")!=-1 || data.indexOf("ERROR")!=-1 )
@@ -390,7 +390,7 @@
     while (millis()-start<3000) {
        if(esp_uart.available()>0)
        {
-       char a =esp_uart.read_char();
+       char a =esp_uart.readChr();
        data=data+a;
        }
        if (data.indexOf("OK")!=-1 || data.indexOf("ERROR")!=-1 )
@@ -488,7 +488,7 @@
     while (millis()-start<3000) {
        if(esp_uart.available()>0)
        {
-       char a =esp_uart.read_char();
+       char a =esp_uart.readChr();
        data=data+a;
        }
        if (data.indexOf("OK")!=-1 || data.indexOf("ERROR")!=-1 )
@@ -577,7 +577,7 @@
     while (millis()-start<3000) {
        if(esp_uart.available()>0)
        {
-       char a =esp_uart.read_char();
+       char a =esp_uart.readChr();
        data=data+a;
        }
        if (data.indexOf("OK")!=-1)
@@ -614,7 +614,7 @@
     while (millis()-start<3000) {
        if(esp_uart.available()>0)
        {
-       char a =esp_uart.read_char();
+       char a =esp_uart.readChr();
        data=data+a;
        }
        if (data.indexOf("OK")!=-1)
@@ -702,7 +702,7 @@
     while (millis()-start<10000) { 
      if(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("OK")!=-1 || data.indexOf("ALREAY CONNECT")!=-1 || data.indexOf("ERROR")!=-1)
@@ -758,7 +758,7 @@
     while (millis()-start<3000) { 
      if(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("OK")!=-1 || data.indexOf("ALREAY CONNECT")!=-1 )
@@ -811,7 +811,7 @@
     while (millis()-start<5000) {
      if(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("SEND OK")!=-1)
@@ -865,7 +865,7 @@
     while (millis()-start<5000) {
      if(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("SEND OK")!=-1)
@@ -891,7 +891,7 @@
     while (millis()-start<3000) {
      if(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("Linked")!=-1 || data.indexOf("ERROR")!=-1 || data.indexOf("we must restart")!=-1)
@@ -918,7 +918,7 @@
     while (millis()-start<3000) {
      if(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("OK")!=-1 || data.indexOf("Link is not")!=-1 || data.indexOf("Cant close")!=-1)
@@ -947,7 +947,7 @@
     while (millis()-start<3000) {
      while(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("AT+CIFSR")!=-1)
@@ -1001,7 +1001,7 @@
     while (millis()-start<3000) {
      if(esp_uart.available()>0)
      {
-     char a =esp_uart.read_char();
+     char a =esp_uart.readChr();
      data=data+a;
      }
      if (data.indexOf("OK")!=-1 || data.indexOf("no charge")!=-1)