SIM800L works with AT command on CoolTerm.

Dependencies:   mbed BufferedSerial SoftSerial

Files at this revision

API Documentation at this revision

Comitter:
kchhouk
Date:
Fri Jan 31 20:55:08 2020 +0000
Commit message:
SIM800L works, with AT command, CoolTerm.

Changed in this revision

BufferedSerial.lib Show annotated file Show diff for this revision Revisions of this file
GSMTest1.cpp Show annotated file Show diff for this revision Revisions of this file
SoftSerial.lib Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BufferedSerial.lib	Fri Jan 31 20:55:08 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/sam_grove/code/BufferedSerial/#7e5e866edd3d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/GSMTest1.cpp	Fri Jan 31 20:55:08 2020 +0000
@@ -0,0 +1,56 @@
+#include "mbed.h"
+#include "BufferedSerial.h"
+#include <string>
+
+//Works with AT Command
+Serial pc(USBTX, USBRX);
+Serial SIM800L(P3_1, P3_0);
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+
+char *phone = "\"17039739276\"";
+//char str[2];
+
+long GSMBAUD = 9600;
+long PCBAUD  = 9600;
+
+int main(){
+    pc.baud(PCBAUD);
+    SIM800L.baud(GSMBAUD);
+/*   
+    SIM800L.puts("AT");
+    SIM800L.puts("\r\n");
+    //wait(0.1f);
+    
+    SIM800L.puts("AT+CMGF=1");
+    SIM800L.puts("\r\n");
+    //wait(0.1f);
+    
+    SIM800L.puts("AT+CMGS=\"17039739276\"");
+    SIM800L.puts("\r\n");
+    //wait(0.1f);
+    
+    SIM800L.printf("Testing SMS from KC.");
+    //SIM800L.puts("\r\n");
+    //wait(0.1f);
+    //wait_ms(500);
+*/  
+    while(1){
+        while(pc.readable()){
+            SIM800L.putc(pc.getc());
+            //SIM800L.printf("%c", SIM800L.putc(pc.getc()));
+            //SIM800L.puts("\r\n");  
+        }   
+        wait(0.1f);
+        while(SIM800L.readable()){
+            //pc.putc(SIM800L.getc());
+            pc.printf("%c", pc.putc(SIM800L.getc()));
+        } 
+        //wait(0.1f);
+
+        
+        
+    }
+    
+    
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SoftSerial.lib	Fri Jan 31 20:55:08 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/Sissors/code/SoftSerial/#a0029614de72
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri Jan 31 20:55:08 2020 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file