This example establishes a transparent link between the mbed serial port and the modem (LISA or SARA) on the C027. You can use it to use the standard u-blox tools such as m-center or any terminal program. These tools can then connect to the serial port and talk directly to the modem. Baudrate should be set to 115200 baud and is fixed. m-center can be downloaded from u-blox website following this link: http://www.u-blox.com/en/evaluation-tools-a-software/u-center/m-center.html

Dependencies:   C027-REVB mbed

Fork of C027_ModemTransparentSerial by u-blox

Revision:
4:e089bc72b28c
Parent:
2:1970ac045983
Child:
5:1f5bb69f15d5
--- a/main.cpp	Wed Nov 06 10:48:56 2013 +0000
+++ b/main.cpp	Fri Dec 13 23:38:22 2013 +0000
@@ -1,11 +1,33 @@
 #include "mbed.h"
 #include "C027.h"
 
+DigitalOut mdm_activity(LED);
+
 int main() 
 {
+    int led_toggle_count = 5;
+
     C027 c027;
-    c027.mdmPower(true);
+    
+    // enable, and use the uart
+    c027.mdmPower(true,true);
+    
+    // enable the GPS.
+    c027.gpsPower(true); 
     
+#if 0
+    while(1) {
+        mdm_activity = !mdm_activity;
+        wait(0.2);
+    }
+#else
+    while( led_toggle_count-- > 0 )
+    {
+        mdm_activity = !mdm_activity;
+        wait(0.2);
+    }
+#endif
+
     // open the mdm serial port
     Serial mdm(MDMTXD, MDMRXD);
     mdm.baud(MDMBAUD);
@@ -17,13 +39,15 @@
     Serial pc(USBTX, USBRX);
     pc.baud(MDMBAUD);
     
+    pc.printf( "M3->UART connection ready\r\n");
+    
     while (1)
     {
         // transfer data from pc to modem
         if (pc.readable() && mdm.writeable())
             mdm.putc(pc.getc());
         // transfer data from modem to pc
-        if (mdm.readable() && pc.writeable())
+        if (mdm.readable() && pc.writeable()) 
             pc.putc(mdm.getc());
     }
 }