インターフェース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:
Thu Apr 17 15:10:09 2014 +0000
Parent:
8:681a7b36c19d
Child:
10:d2da2028a233
Commit message:
Make defines to easier change the user config.

Changed in this revision

C027.lib Show annotated file Show diff for this revision Revisions of this file
C027_Support.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	Thu Apr 10 13:45:20 2014 +0000
+++ b/C027.lib	Thu Apr 17 15:10:09 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/ublox/code/C027/#8ca897c3cf41
+http://mbed.org/teams/ublox/code/C027/#06d5a702779c
--- a/C027_Support.lib	Thu Apr 10 13:45:20 2014 +0000
+++ b/C027_Support.lib	Thu Apr 17 15:10:09 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/ublox/code/C027_Support/#cc3433329d66
+http://mbed.org/teams/ublox/code/C027_Support/#a89a7a505991
--- a/main.cpp	Thu Apr 10 13:45:20 2014 +0000
+++ b/main.cpp	Thu Apr 17 15:10:09 2014 +0000
@@ -3,6 +3,28 @@
 #include "GPS.h"
 #include "MDM.h"
 
+//----------------------------------------------------------------------
+// You may need to configure these parameters
+
+/** Set your secret SIM pin here "1234"
+*/
+#define SIMPIN      NULL
+
+/** The APN of your network operator, sometimes it is "internet" 
+    check your contract with the network operator
+*/
+#define APN         "gprs.swisscom.ch"
+
+/** Set the user name for your APN, or NULL if not needed
+*/
+#define USERNAME    NULL
+
+/** Set the password for your APN, or NULL if not needed
+*/
+#define PASSWORD    NULL 
+
+//----------------------------------------------------------------------
+
 C027 c027;
 
 void printDeviceStatus(MDMParser::DevStatus* status) {
@@ -75,7 +97,7 @@
     printf("Device Init\r\n");
     MDMParser::DevStatus devStatus;
     MDMParser::NetStatus netStatus;
-    if (mdm.init(/* SIM PIN = */ NULL, &devStatus))
+    if (mdm.init(SIMPIN, &devStatus))
     {
         printDeviceStatus(&devStatus);
         
@@ -88,9 +110,7 @@
         printf("Network Join\r\n");
         // join the internet connection 
         MDMParser::IP ip = 
-            mdm.join(/* APN      = */ "gprs.swisscom.ch", 
-                     /* USER     = */ NULL, 
-                     /* PASSWORD = */ NULL);
+            mdm.join(APN,USERNAME,PASSWORD);
         if (ip != NOIP)
         {
             printf("  IP Address: " IPSTR "\r\n", IPNUM(ip));
@@ -187,7 +207,7 @@
                 }
             }
             wait_ms(wait);
-        }  
+        }
         mdm.powerOff();
         gps.powerOff();
     }