Communicate to bluetooth devices or wifi per at-commands

Dependents:   Nucleo_bt

Revision:
6:194ceedbb7c3
Parent:
5:31306be5fde6
Child:
7:0ee37a450b12
--- a/at.cpp	Sun Aug 26 20:16:16 2018 +0000
+++ b/at.cpp	Mon Aug 27 08:30:46 2018 +0000
@@ -23,7 +23,7 @@
     at0.sign = atserial0.getc();
 
 
-    if(at0.sign != '\r')  {  //with no linefeed and carriage return, string is written in buffer
+    if((pc.sign != '\r') && (pc.sign != '\n'))  {  //with no linefeed and carriage return, string is written in buffer
         at0.buffer[at0.a] = at0.sign;
         at0.a ++;
     } else {   //if cr and lf were received , the content of buffer is send to atcommand device
@@ -40,7 +40,7 @@
     at1.sign = atserial1.getc();
 
 
-    if(at1.sign != '\r')  {  //with no linefeed and carriage return, string is written in buffer
+    if((pc.sign != '\r') && (pc.sign != '\n'))  {  //with no linefeed and carriage return, string is written in buffer
         at1.buffer[at1.a] = at1.sign;
         at1.a ++;
     } else {   //if cr and lf were received, the content of buffer is send to atcommand device
@@ -57,7 +57,7 @@
     pc.sign = terminal.getc();
 
 
-    if(pc.sign != '\r')  {  //with no linefeed and carriage return, string is written in buffer
+    if((pc.sign != '\r') && (pc.sign != '\n'))  {  //with no linefeed and carriage return, string is written in buffer
         pc.buffer[pc.a] = pc.sign;
         pc.a ++;
     } else {   //if cr and lf were received, the content of buffer is send to atcommand device