Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: example-ublox-cellular-interface HelloMQTT example-ublox-cellular-interface_r410M example-ublox-mbed-client
Revision 3:9863dcade75d, committed 2018-02-28
- 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
--- 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
--- 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;
 }
--- 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();
 };