From Arduino code, I have a question for SoftwareSerial Class
First: when I use more example for Esp8266 those functions use while loop to read response string from Esp when we send AT_Command to ESP.
getResponse(const uint32_t wait) {
String tmpData = "";
long int time = millis();
while ((time + wait) > millis()) {
while (esp8266->available() > 0) {
char c = esp8266->read();
if (c == '\0') continue;
tmpData += c;
}
}
tmpData.trim();
return tmpData;
}
I know that SoftwareSerial Class have a public method is readString() then I'm tried to use that and it return same result returned by while loop read:
getResponse(const uint32_t wait) {
String tmpData = "";
tmpData = esp8266->readString();
return tmpData;
}
Thanks for any. I'm working on improving my Eng. Regards