Index: rtos_arduino/trunk/arduino_lib/libraries/ESP8266/ESP8266.cpp
===================================================================
--- rtos_arduino/trunk/arduino_lib/libraries/ESP8266/ESP8266.cpp	(revision 142)
+++ rtos_arduino/trunk/arduino_lib/libraries/ESP8266/ESP8266.cpp	(revision 143)
@@ -7,4 +7,6 @@
  * @par Copyright:
  * Copyright (c) 2015 ITEAD Intelligent Systems Co., Ltd. \n\n
+ * Copyright (C) 2015 Embedded and Real-Time Systems Laboratory
+ *              Graduate School of Information Science, Nagoya Univ., JAPAN \n\n
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -23,4 +25,10 @@
 #define LOG_OUTPUT_DEBUG            (1)
 #define LOG_OUTPUT_DEBUG_PREFIX     (1)
+
+#ifdef TOPPERS_WITH_ARDUINO
+#define WAIT_TIMEOUT delay(1);
+#else /* !TOPPERS_WITH_ARDUINO */
+#define WAIT_TIMEOUT
+#endif /* TOPPERS_WITH_ARDUINO */
 
 #define logDebug(arg)\
@@ -43,10 +51,10 @@
 
 #ifdef ESP8266_USE_SOFTWARE_SERIAL
-ESP8266::begin(SoftwareSerial &uart, uint32_t baud)
+void ESP8266::begin(SoftwareSerial &uart, uint32_t baud)
 {
     m_puart = &uart;
     m_baud = baud;
     m_puart->begin(baud);
-    rx_empty();            
+    rx_empty();
 }
 #else
@@ -56,5 +64,5 @@
     m_baud = baud;
     m_puart->begin(baud);
-    rx_empty();        
+    rx_empty();
 }
 #endif
@@ -306,4 +314,9 @@
 }
 
+int ESP8266::dataAvailable(void)
+{
+    return (m_puart->available() > 0)? 1 : 0;
+}
+            
 /*----------------------------------------------------------------------------*/
 /* +IPD,<id>,<len>:<data> */
@@ -334,5 +347,5 @@
             data += a;
         }else{
-            delay(1);
+            WAIT_TIMEOUT;
         }
         
@@ -366,5 +379,5 @@
     if (has_data) {
         i = 0;
-        ret = len > buffer_size ? buffer_size : len;
+        ret = (uint32_t)len > buffer_size ? buffer_size : len;
         start = millis();
         while (millis() - start < 3000) {
@@ -383,5 +396,5 @@
                 return ret;
             }
-            delay(1);
+            WAIT_TIMEOUT
         }
     }
@@ -410,5 +423,5 @@
             break;
         }
-        delay(1);
+        WAIT_TIMEOUT
     }
     return data;
@@ -416,25 +429,4 @@
 
 String ESP8266::recvString(String target1, String target2, uint32_t timeout)
-{
-    String data;
-    char a;
-    unsigned long start = millis();
-    while (millis() - start < timeout) {
-        while(m_puart->available() > 0) {
-            a = m_puart->read();
-			if(a == '\0') continue;
-            data += a;
-        }
-        if (data.indexOf(target1) != -1) {
-            break;
-        } else if (data.indexOf(target2) != -1) {
-            break;
-        }
-        delay(1);
-    }
-    return data;
-}
-
-String ESP8266::recvString(String target1, String target2, String target3, uint32_t timeout)
 {
     String data;
@@ -451,8 +443,29 @@
         } else if (data.indexOf(target2) != -1) {
             break;
+        }
+        WAIT_TIMEOUT
+    }
+    return data;
+}
+
+String ESP8266::recvString(String target1, String target2, String target3, uint32_t timeout)
+{
+    String data;
+    char a;
+    unsigned long start = millis();
+    while (millis() - start < timeout) {
+        while(m_puart->available() > 0) {
+            a = m_puart->read();
+            if(a == '\0') continue;
+            data += a;
+        }
+        if (data.indexOf(target1) != -1) {
+            break;
+        } else if (data.indexOf(target2) != -1) {
+            break;
         } else if (data.indexOf(target3) != -1) {
             break;
         }
-        delay(1);
+        WAIT_TIMEOUT
     }
     return data;
Index: rtos_arduino/trunk/arduino_lib/libraries/ESP8266/ESP8266.h
===================================================================
--- rtos_arduino/trunk/arduino_lib/libraries/ESP8266/ESP8266.h	(revision 142)
+++ rtos_arduino/trunk/arduino_lib/libraries/ESP8266/ESP8266.h	(revision 143)
@@ -7,4 +7,6 @@
  * @par Copyright:
  * Copyright (c) 2015 ITEAD Intelligent Systems Co., Ltd. \n\n
+ * Copyright (C) 2015 Embedded and Real-Time Systems Laboratory
+ *              Graduate School of Information Science, Nagoya Univ., JAPAN \n\n  
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -41,5 +43,5 @@
 #ifdef ESP8266_USE_SOFTWARE_SERIAL
     /*
-     * Constuctor. 
+     * Begin.
      *
      * @param uart - an reference of SoftwareSerial object. 
@@ -51,5 +53,5 @@
 #else /* HardwareSerial */
     /*
-     * Constuctor. 
+     * Begin.
      *
      * @param uart - an reference of HardwareSerial object. 
@@ -402,4 +404,11 @@
      */
     uint32_t recv(uint8_t *coming_mux_id, uint8_t *buffer, uint32_t buffer_size, uint32_t timeout = 1000);
+
+    /**
+     * Check data is available.
+     *
+     * @return 1 : data is available, 0 : data is not available
+     */
+    int dataAvailable(void);
 
  private:
Index: rtos_arduino/trunk/arduino_lib/libraries/ESP8266/README.md
===================================================================
--- rtos_arduino/trunk/arduino_lib/libraries/ESP8266/README.md	(revision 142)
+++ rtos_arduino/trunk/arduino_lib/libraries/ESP8266/README.md	(revision 143)
@@ -1,11 +1,12 @@
 @mainpage
 
-# WeeESP8266
+# WeeESP8266 updated for Milkcoca SDK
 
 An ESP8266 library for Arduino providing an easy-to-use way to manipulate ESP8266.
+Updated to support Milkcoca SDK<>, M0 and TOPPERS/R2CA.
 
 # Source 
-
-Source can be download at <https://github.com/itead/ITEADLIB_Arduino_WeeESP8266>.
+Source can be download at <>.
+Original source can be download at <https://github.com/itead/ITEADLIB_Arduino_WeeESP8266>.
 
 You can clone it by:
@@ -93,4 +94,15 @@
     uint32_t 	recv (uint8_t *coming_mux_id, uint8_t *buffer, uint32_t buffer_size, uint32_t timeout=1000) : Receive data from all of TCP or UDP builded already in multiple mode. 
 
+# Added API List
+
+    void 	begin(SoftwareSerial &uart, uint32_t baud = 115200); : Begin ESP8266.
+
+    void 	begin(SoftwareSerial &uart, uint32_t baud = 115200); : Begin ESP8266.
+
+    bool 	send(String &str); : Send data based on TCP or UDP builded already in single mode. 
+
+    bool 	send(uint8_t mux_id, String &str); : Send data based on one of TCP or UDP builded already in multiple mode. 
+
+    int 	dataAvailable(void); : Check data is available.
 
 # Mainboard Requires
@@ -103,4 +115,5 @@
   - Arduino UNO and its derivatives
   - Arduino MEGA and its derivatives
+  - Arduino M0 and its derivatives
   - [Iteaduino UNO](http://imall.iteadstudio.com/im130312001.html)
   - [WBoard Pro](http://imall.iteadstudio.com/im141125005.html)
@@ -165,6 +178,10 @@
 defined in HardwareSerial.h is too small.
 
+UNO or MEGA or WBoard Pro
 Open the file from `\arduino\hardware\arduino\avr\cores\arduino\HardwareSerial.h`. 
-See the follow line in the HardwareSerial.h file.
+
+M0
+Open the file from `\arduino\hardware\arduino\avr\cores\arduino\RingBuffer.h`. 
+See the follow line in the file.
 
     #define SERIAL_BUFFER_SIZE 64
