Implementation of the CellularInterface for u-blox C027 and C030 (non-N2xx flavour) modems that uses the IP stack on-board the cellular modem, hence not requiring LWIP (and so less RAM) and allowing any AT command exchanges to be carried out at the same time as data transfers (since the modem remains in AT mode all the time). This library may be used from mbed 5.5 onwards. If you need to use SMS, USSD or access the modem file system at the same time as using the CellularInterface then use ublox-at-cellular-interface-ext instead.

Dependents:   example-ublox-cellular-interface example-ublox-cellular-interface_r410M example-ublox-mbed-client example-ublox-cellular-interface ... more

Revision:
12:ff6fac481487
Parent:
6:63dad754c267
Child:
21:2a500a881a5a
Child:
22:63b1a3c02fb8
--- a/TESTS/unit_tests/default/main.cpp	Mon Oct 30 14:48:14 2017 +0000
+++ b/TESTS/unit_tests/default/main.cpp	Tue Jan 09 13:20:44 2018 +0000
@@ -489,6 +489,65 @@
 // TESTS
 // ----------------------------------------------------------------
 
+// Tests of stuff in the base class
+void test_base_class() {
+    const char *imei;
+    const char *meid;
+    const char *imsi;
+    const char *iccid;
+    int rssi;
+    
+    // Power-up the modem
+    interface->init();
+    
+    // Check all of the IMEI, MEID, IMSI and ICCID calls
+    imei = interface->imei();
+    if (imei != NULL) {
+        tr_debug("IMEI is %s.", imei);
+    } else {
+        TEST_ASSERT(false);
+    }
+    
+    meid = interface->meid();
+    if (meid != NULL) {
+        tr_debug("MEID is %s.", meid);
+    } else {
+        TEST_ASSERT(false);
+    }
+    
+    imsi = interface->imsi();
+    if (imsi != NULL) {
+        tr_debug("IMSI is %s.", imsi);
+    } else {
+        TEST_ASSERT(false);
+    }
+    
+    iccid = interface->iccid();
+    if (iccid != NULL) {
+        tr_debug("ICCID is %s.", iccid);
+    } else {
+        TEST_ASSERT(false);
+    }
+    
+    // Check the RSSI call at least doesn't assert
+    rssi = interface->rssi();
+    tr_debug("RSSI is %d dBm.", rssi);
+    
+    // Now connect and check that the answers for the
+    // static fields are the same while connected
+    TEST_ASSERT(interface->connect(MBED_CONF_APP_DEFAULT_PIN, MBED_CONF_APP_APN,
+                                   MBED_CONF_APP_USERNAME, MBED_CONF_APP_PASSWORD) == 0);
+    
+    TEST_ASSERT(strcmp(imei, interface->imei()) == 0);
+    TEST_ASSERT(strcmp(meid, interface->meid()) == 0);
+    TEST_ASSERT(strcmp(imsi, interface->imsi()) == 0);
+    TEST_ASSERT(strcmp(iccid, interface->iccid()) == 0);
+
+    // Check that the RSSI call still doesn't assert
+    rssi = interface->rssi();
+    tr_debug("RSSI is %d dBm.", rssi);
+}
+
 // Call srand() using the NTP server
 void test_set_randomise() {
     UDPSocket sock;
@@ -1024,6 +1083,7 @@
 
 // Test cases
 Case cases[] = {
+    Case("Base class tests", test_base_class),
     Case("Set randomise", test_set_randomise),
 #ifdef MBED_CONF_APP_ECHO_SERVER
     Case("UDP echo test", test_udp_echo),
@@ -1072,4 +1132,3 @@
 }
 
 // End Of File
-