インターフェース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:
Wed Apr 09 13:04:06 2014 +0000
Parent:
5:5366d39d3719
Child:
7:e000317ddef6
Commit message:
improvement with CMDA

Changed in this revision

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_Support.lib	Wed Apr 09 11:48:52 2014 +0000
+++ b/C027_Support.lib	Wed Apr 09 13:04:06 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/teams/ublox/code/C027_Support/#a0bed6c1e05d
+http://mbed.org/teams/ublox/code/C027_Support/#8f12ac182bbb
--- a/main.cpp	Wed Apr 09 11:48:52 2014 +0000
+++ b/main.cpp	Wed Apr 09 13:04:06 2014 +0000
@@ -7,18 +7,24 @@
 
 void printDeviceStatus(MDMParser::DevStatus* status) {
     printf("Device Status:\r\n");
-    const char* txtModel[] = { "Unknown", "SARA-G350", "LISA-U200", "LISA-C200" };
-    if (status->model < sizeof(txtModel)/sizeof(*txtModel) && (status->model != MDMParser::MODEL_UNKNOWN))
-        printf("  Model: %s\r\n", txtModel[status->model]);
+    const char* txtDev[] = { "Unknown", "SARA-G350", "LISA-U200", "LISA-C200" };
+    if (status->dev < sizeof(txtDev)/sizeof(*txtDev) && (status->dev != MDMParser::DEV_UNKNOWN))
+        printf("  Device:       %s\r\n", txtDev[status->dev]);
     const char* txtSim[] = { "Unknown", "Pin", "Ready" };
     if (status->sim < sizeof(txtSim)/sizeof(*txtSim) && (status->sim != MDMParser::SIM_UNKNOWN))
-        printf("  SIM:   %s\r\n", txtSim[status->sim]);
-    if (status->ccid)  
-        printf("  CCID:  %s\r\n", status->ccid);
-    if (status->imei) 
-        printf("  IMEI:  %s\r\n", status->imei);
-    if (status->imsi)  
-        printf("  IMSI:  %s\r\n", status->imsi);
+        printf("  SIM:          %s\r\n", txtSim[status->sim]);
+    if (*status->ccid)  
+        printf("  CCID:         %s\r\n", status->ccid);
+    if (*status->imei) 
+        printf("  IMEI:         %s\r\n", status->imei);
+    if (*status->imsi)  
+        printf("  IMSI:         %s\r\n", status->imsi);
+    if (*status->manu) 
+        printf("  Manufacturer: %s\r\n", status->manu);
+    if (*status->model)  
+        printf("  Model:        %s\r\n", status->model);
+    if (*status->ver)  
+        printf("  Version:      %s\r\n", status->ver);
 }
 
 void printNetStatus(MDMParser::NetStatus *status)
@@ -32,9 +38,9 @@
         printf("  Access Technology:  %s\r\n", txtAct[status->act]);
     if (status->rssi) 
         printf("  Signal Strength:    %d dBm\r\n", status->rssi);
-    if (status->opr)  
+    if (*status->opr)  
         printf("  Operator:           %s\r\n", status->opr);
-    if (status->num)  
+    if (*status->num)  
         printf("  Phone Number:       %s\r\n", status->num);
 }
 
@@ -61,7 +67,7 @@
                 );
                 
     // initialize the modem 
-    printf("Init\r\n");
+    printf("Device Init\r\n");
     MDMParser::DevStatus devStatus;
     MDMParser::NetStatus netStatus;
     if (mdm.init(/* SIM PIN = */ NULL, &devStatus))
@@ -82,7 +88,7 @@
                      /* PASSWORD = */ NULL);
         if (ip != NOIP)
         {
-            printf("IP Address: " IPSTR "\r\n", IPNUM(ip));
+            printf("  IP Address: " IPSTR "\r\n", IPNUM(ip));
             printf("Socket Create\r\n");
             int socket = mdm.socketSocket(MDMParser::IPPROTO_TCP);
             if (socket >= 0)