Library that implements the CellularInterface using PPP and LWIP on the mbed MCU. May be used on the C027 and C030 (non-N2xx flavour) boards from mbed 5.5 onwards.

Dependents:   example-ublox-cellular-interface HelloMQTT example-ublox-cellular-interface_r410M example-ublox-mbed-client

Files at this revision

API Documentation at this revision

Comitter:
RobMeades
Date:
Wed Feb 28 17:33:50 2018 +0000
Parent:
2:4c533665168c
Commit message:
PR 6032 into mbed-os changed the signature of the PPP connection_status_cb() (it now carries two parameters rather than one). This change fixes the UbloxPPPCellularInterface to work with that PR.

Changed in this revision

TESTS/unit_tests/default/main.cpp Show annotated file Show diff for this revision Revisions of this file
UbloxPPPCellularInterface.cpp Show annotated file Show diff for this revision Revisions of this file
UbloxPPPCellularInterface.h Show annotated file Show diff for this revision Revisions of this file
diff -r 4c533665168c -r 9863dcade75d TESTS/unit_tests/default/main.cpp
--- a/TESTS/unit_tests/default/main.cpp	Fri Jun 30 13:30:20 2017 +0100
+++ b/TESTS/unit_tests/default/main.cpp	Wed Feb 28 17:33:50 2018 +0000
@@ -215,9 +215,11 @@
 #endif
 
 // Callback in case the connection goes down
-void connection_down_cb(nsapi_error_t err)
+void connection_down_cb(nsapi_event_t event, intptr_t x)
 {
-    connection_has_gone_down = true;
+    if ((nsapi_connection_status_t) x == NSAPI_STATUS_DISCONNECTED) {
+        connection_has_gone_down = true;
+    }
 }
 
 #ifdef MBED_CONF_APP_ECHO_SERVER
diff -r 4c533665168c -r 9863dcade75d UbloxPPPCellularInterface.cpp
--- a/UbloxPPPCellularInterface.cpp	Fri Jun 30 13:30:20 2017 +0100
+++ b/UbloxPPPCellularInterface.cpp	Wed Feb 28 17:33:50 2018 +0000
@@ -344,7 +344,7 @@
 }
 
 // Set the callback to be called in case the connection is lost.
-void UbloxPPPCellularInterface::connection_status_cb(Callback<void(nsapi_error_t)> cb)
+void UbloxPPPCellularInterface::connection_status_cb(Callback<void(nsapi_event_t, intptr_t)> cb)
 {
     _connection_status_cb = cb;
 }
diff -r 4c533665168c -r 9863dcade75d UbloxPPPCellularInterface.h
--- a/UbloxPPPCellularInterface.h	Fri Jun 30 13:30:20 2017 +0100
+++ b/UbloxPPPCellularInterface.h	Wed Feb 28 17:33:50 2018 +0000
@@ -197,7 +197,7 @@
      *
      * @param fptr     the function to call.
      */
-    void connection_status_cb(Callback<void(nsapi_error_t)> cb);
+    void connection_status_cb(Callback<void(nsapi_event_t, intptr_t)> cb);
 
 protected:
 
@@ -232,7 +232,7 @@
     bool _sim_pin_check_change_pending_enabled_value;
     bool _sim_pin_change_pending;
     const char *_sim_pin_change_pending_new_pin_value;
-    Callback<void(nsapi_error_t)> _connection_status_cb;
+    Callback<void(nsapi_event_t, intptr_t)> _connection_status_cb;
     nsapi_error_t setup_context_and_credentials();
     bool set_atd();
 };