Zhengyang Gu / Mbed 2 deprecated C027_ModemTransparentSerial_BBB

Dependencies:   mbed

Fork of C027_ModemTransparentSerial by u-blox

Files at this revision

API Documentation at this revision

Comitter:
MrGu
Date:
Fri Oct 02 09:47:53 2015 +0000
Parent:
8:b561b2003e76
Commit message:
Talk with GSM modem from serial port

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Thu Jun 12 07:28:57 2014 +0000
+++ b/main.cpp	Fri Oct 02 09:47:53 2015 +0000
@@ -1,9 +1,6 @@
 #include "mbed.h"
-#ifdef TARGET_UBLOX_C027
- #include "C027_api.h"
-#else
- #error "This example is targeted for the C027 platform"
-#endif
+#include "C027_api.h"
+
 
 /* This example is establishing a transparent link between 
    the mbed serial port and the serial communication interface 
@@ -29,15 +26,19 @@
     mdm.set_flow_control(SerialBase::RTSCTS, MDMRTS,MDMCTS);
     
     // open the PC serial port and (use the same baudrate)
-    Serial pc(USBTX, USBRX);
+    Serial pc(P4_28, P4_29);
     pc.baud(MDMBAUD);
     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())
+        {
             pc.putc(mdm.getc());
+        }
     }
 }