bool ESP8266::eATCIFSR(String &list, uint8_t mode) { rx_empty(); sendAT("CIFSR"); if(mode == 2) return recvFindAndFilter("OK", "+CIFSR:APIP,\"", "\"\r\n+CIFSR:APMAC", list); else return recvFindAndFilter("OK", "+CIFSR:STAIP,\"", "\"\r\n+CIFSR:STAMAC", list); }
bool ESP::eATCIFSR(String &list, uint8_t type) { flush(); this->serial->println(F("AT+CIFSR")); if (type) return recvFindAndFilter(F("OK"), F("STAIP,"), F("+CIFSR:STAMAC"), list, COMMAND_TIMEOUT); else return recvFindAndFilter(F("OK"), F("\r\r\n"), F("\r\n\r\nOK"), list, COMMAND_TIMEOUT); }
bool ESP8266::eATCWLIF(String &list) { String data; rx_empty(); m_puart->println(F("AT+CWLIF")); return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", list); }
bool ESP8266::eATCWLIF(String &list) { String data; rx_empty(); sendAT("CWLIF"); return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", list); }
bool ESP8266::qATCWMODE(uint8_t *mode,uint8_t pattern) { String str_mode; bool ret; if (!mode||!pattern) { return false; } rx_empty(); switch(pattern) { case 1 : m_puart->println(F("AT+CWMODE_DEF?")); break; case 2: m_puart->println(F("AT+CWMODE_CUR?")); break; default: m_puart->println(F("AT+CWMODE?")); } ret = recvFindAndFilter("OK", ":", "\r\n\r\nOK", str_mode); if (ret) { *mode = (uint8_t)str_mode.toInt(); return true; } else { return false; } }
bool ESP8266::eATGMR(String &version) { rx_empty(); delay(3000); m_puart->println(F("AT+GMR")); return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", version,10000); }
bool ESP8266::eATCIPSTATUS(String &list) { String data; delay(100); rx_empty(); sendAT("CIPSTATUS"); return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", list); }
bool ESP8266::eATCIPSTATUS(String &list) { String data; delay(100); rx_empty(); m_puart->println(F("AT+CIPSTATUS")); return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", list); }
bool ESP::eATCIPSTATUS(String &list) { String data; delay(100); flush(); this->serial->println(F("AT+CIPSTATUS")); return recvFindAndFilter(F("OK"), F("\r\r\n"), F("\r\n\r\nOK"), list, COMMAND_TIMEOUT); }
///for getIPStatus (sync) bool ESP8266::eATCIPSTATUS(String &list) { //state = STATE_getIPStatus; String data; delay(100); rx_empty(); m_puart->println("AT+CIPSTATUS"); return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", list); }
bool ESP8266::qCWAUTOCONN() { String str_mode; rx_empty(); sendAT("CWAUTOCONN?"); bool ret = recvFindAndFilter("OK", "+CWAUTOCONN:", "\r\n\r\nOK", str_mode); if (ret) { return (uint8_t) str_mode.toInt(); } else { return false; } }
bool ESP8266::qATCWMODE(uint8_t *mode) { String str_mode; bool ret; if (!mode) { return false; } rx_empty(); sendAT("CWMODE?"); ret = recvFindAndFilter("OK", "+CWMODE:", "\r\n\r\nOK", str_mode); if (ret) { *mode = (uint8_t)str_mode.toInt(); return true; } else { return false; } }
bool ESP::qATCWMODE(uint8_t *mode) { String str_mode; bool ret; if (!mode) { return false; } flush(); this->serial->println(F("AT+CWMODE?")); ret = recvFindAndFilter(F("OK"), F("+CWMODE:"), F("\r\n\r\nOK"), str_mode, COMMAND_TIMEOUT); if (ret) { *mode = (uint8_t)str_mode.toInt(); return true; } else { return false; } }
bool ESP8266::qATCWDHCP(String &List,uint8_t pattern) { if (!pattern) { return false; } rx_empty(); switch(pattern) { case 1 : m_puart->println(F("AT+CWDHCP_DEF?")); break; case 2: m_puart->println(F("AT+CWDHCP_CUR?")); break; default: m_puart->println(F("AT+CWDHCP?")); } return recvFindAndFilter("OK", "\r\r\n", "\r\nOK", List,10000); }
bool ESP8266::qATCIPSTAIP(String &ip,uint8_t pattern) { rx_empty(); if (!pattern) { return false; } switch(pattern){ case 1 : m_puart->println(F("AT+CIPSTA_DEF?")); break; case 2: m_puart->println(F("AT+CIPSTA_CUR?")); break; default: m_puart->println(F("AT+CIPSTA?")); } return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", ip,2000); }
bool ESP8266::eATGMR(String &version) { rx_empty(); sendAT("GMR"); return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", version); }
bool ESP::eATGMR(String &version) { flush(); this->serial->println(F("AT+GMR")); return recvFindAndFilter(F("OK"), F("\r\r\n"), F("\r\n\r\nOK"), version, COMMAND_TIMEOUT); }
bool ESP8266::eATCWMODE(String &list) { rx_empty(); m_puart->println(F("AT+CWMODE=?")); return recvFindAndFilter("OK", "+CWMODE:(", ")\r\n\r\nOK", list); }
bool ESP8266::eATCIFSR(String &list) { rx_empty(); m_puart->println(F("AT+CIFSR")); return recvFindAndFilter("OK", "\r\r\n", "\r\n\r\nOK", list); }