インターフェース2014年10月号のu-blox C027で3G通信する記事で使用したプログラム。   CQ publishing Interface 2014.10 issue, C027 3G test program.

Dependencies:   C027_Support C027_SupportTest mbed picojson

Fork of C027_SupportTest by u-blox

インターフェース2014年10月号のu-blox C027で3G通信する記事で使用したプログラムです。

Files at this revision

API Documentation at this revision

Comitter:
mazgch
Date:
Fri May 09 11:57:47 2014 +0000
Parent:
12:96c7b62c7aaf
Child:
14:ab7c8627f950
Commit message:
update for new native C027 platform

Changed in this revision

C027.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/C027.lib	Fri May 09 08:58:25 2014 +0000
+++ b/C027.lib	Fri May 09 11:57:47 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/ublox/code/C027/#61d31c12230d
+http://mbed.org/teams/ublox/code/C027/#89c45165ee87
--- a/main.cpp	Fri May 09 08:58:25 2014 +0000
+++ b/main.cpp	Fri May 09 11:57:47 2014 +0000
@@ -34,23 +34,14 @@
    - Freescale: FRDM-KL25Z, FRDM-KL46Z
    - STM:       NUCLEO-F401RE, NUCLEO-F030R8
 */
-#if defined(TARGET_UBLOX_C027) || defined(TARGET_LPC1768)
-  #define C027_USEONBOARD // remove this if you have a GSM/GPS shield
-  #ifdef C027_USEONBOARD
-    #include "C027.h"
-    C027 c027;
-  #elif defined(TARGET_LPC1768) 
-    // We assume we have a C027 (not an Arch Pro)
-    #define D15  P0_1
-    #define D14  P0_0
-    #define D4   P2_12
-    #define D1   P4_28
-    #define D0   P4_29
-    #define LED1 P3_25
-  #endif
+#if defined(TARGET_UBLOX_C027)
+  #define C027_USEONBOARD // remove this if you have the GSM/GPS shield mounted
 #endif
 
-#ifndef C027_USEONBOARD
+#ifdef C027_USEONBOARD
+  #include "C027.h"
+  C027 c027;
+#else
   #define GPSSCL    D15
   #define GPSSDA    D14
   #define GPSADR   (66<<1) // GPS I2C Address
@@ -114,7 +105,7 @@
     int ret;
     char buf[512] = "";
 
-    // only trace if 
+    // only trace if the serial is different from our modem port
     if ((USBRX!=MDMRXD)&&(USBTX!=MDMTXD)) {
         Serial pc(USBTX,USBRX);
         pc.baud(115200);
@@ -137,10 +128,10 @@
     wait(2);
     
     // Create the GPS object
-#if defined(GPSSCL) && defined(GPSSDA) && defined(GPSADR)
-    GPSI2C gps(GPSSDA,GPSSCL,GPSADR);     // use GPSI2C class
-#elif defined(GPSTXD) && defined(GPSRXD) && defined(GPSBAUD)
-    GPSSerial gps(GPSTXD,GPSRXD,GPSBAUD); // or GPSSerial class 
+#if GPSADR    // use GPSI2C class
+    GPSI2C gps(GPSSDA,GPSSCL,GPSADR); 
+#elif GPSBAUD // or GPSSerial class 
+    GPSSerial gps(GPSTXD,GPSRXD,GPSBAUD); 
 #else
     #warning "please define the pins for the GPS"
 #endif