Added variable AT line feed characters

This commit is contained in:
Jan Gromeš 2018-03-31 10:06:45 +02:00
parent 8e5a9d59b5
commit 7b54c152dd
3 changed files with 3 additions and 1 deletions

View file

@ -7,6 +7,7 @@ ESP8266::ESP8266(Module* module) {
}
uint8_t ESP8266::begin(long speed) {
_mod->AtLineFeed = "\r\n";
_mod->baudrate = speed;
_mod->init(USE_UART, INT_NONE);
_mod->ATemptyBuffer();

View file

@ -62,7 +62,7 @@ bool Module::ATsendCommand(String& cmd) {
bool Module::ATsendCommand(const char* cmd) {
ATemptyBuffer();
ModuleSerial->print(cmd);
ModuleSerial->print("\r\n");
ModuleSerial->print(AtLineFeed);
return(ATgetResponse());
}

View file

@ -18,6 +18,7 @@ class Module {
SoftwareSerial* ModuleSerial;
uint32_t baudrate = 9600;
String AtLineFeed = "\r\n";
uint8_t init(uint8_t interface, uint8_t gpio);