Added variable AT line feed characters
This commit is contained in:
parent
8e5a9d59b5
commit
7b54c152dd
3 changed files with 3 additions and 1 deletions
|
@ -7,6 +7,7 @@ ESP8266::ESP8266(Module* module) {
|
||||||
}
|
}
|
||||||
|
|
||||||
uint8_t ESP8266::begin(long speed) {
|
uint8_t ESP8266::begin(long speed) {
|
||||||
|
_mod->AtLineFeed = "\r\n";
|
||||||
_mod->baudrate = speed;
|
_mod->baudrate = speed;
|
||||||
_mod->init(USE_UART, INT_NONE);
|
_mod->init(USE_UART, INT_NONE);
|
||||||
_mod->ATemptyBuffer();
|
_mod->ATemptyBuffer();
|
||||||
|
|
|
@ -62,7 +62,7 @@ bool Module::ATsendCommand(String& cmd) {
|
||||||
bool Module::ATsendCommand(const char* cmd) {
|
bool Module::ATsendCommand(const char* cmd) {
|
||||||
ATemptyBuffer();
|
ATemptyBuffer();
|
||||||
ModuleSerial->print(cmd);
|
ModuleSerial->print(cmd);
|
||||||
ModuleSerial->print("\r\n");
|
ModuleSerial->print(AtLineFeed);
|
||||||
return(ATgetResponse());
|
return(ATgetResponse());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,7 @@ class Module {
|
||||||
SoftwareSerial* ModuleSerial;
|
SoftwareSerial* ModuleSerial;
|
||||||
|
|
||||||
uint32_t baudrate = 9600;
|
uint32_t baudrate = 9600;
|
||||||
|
String AtLineFeed = "\r\n";
|
||||||
|
|
||||||
uint8_t init(uint8_t interface, uint8_t gpio);
|
uint8_t init(uint8_t interface, uint8_t gpio);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue