[Module] Removed String class from AT commands

pull/142/head
jgromes 2020-03-22 08:14:03 +01:00
rodzic caa05f8ad8
commit d3cec5d3b4
2 zmienionych plików z 7 dodań i 6 usunięć

Wyświetl plik

@ -137,19 +137,20 @@ bool Module::ATsendData(uint8_t* data, uint32_t len) {
}
bool Module::ATgetResponse() {
String data = "";
char data[128];
char* dataPtr = data;
uint32_t start = millis();
while (millis() - start < _ATtimeout) {
while(millis() - start < _ATtimeout) {
while(ModuleSerial->available() > 0) {
char c = ModuleSerial->read();
RADIOLIB_VERBOSE_PRINT(c);
data += c;
*dataPtr++ = c;
}
if(data.indexOf("OK") != -1) {
if(strstr(data, "OK") == 0) {
RADIOLIB_VERBOSE_PRINTLN();
return(true);
} else if (data.indexOf("ERROR") != -1) {
} else if(strstr(data, "ERROR") == 0) {
RADIOLIB_VERBOSE_PRINTLN();
return(false);
}

Wyświetl plik

@ -172,7 +172,7 @@ class Module {
/*!
\brief Get response after sending AT command.
\returns True if AT response contains the string "OK", false otehrwise.
\returns True if AT response contains the string "OK", false otherwise.
*/
bool ATgetResponse();