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

Files at this revision

API Documentation at this revision

Comitter:
fahimalavi
Date:
Wed Jan 01 11:47:24 2020 +0500
Parent:
40:9299d6d117f1
Child:
42:98808477a691
Commit message:
mbed-os 5.15: String-based APIs are deprecated

Changed in this revision

UbloxATCellularInterface.cpp Show annotated file Show diff for this revision Revisions of this file
UbloxATCellularInterface.h Show annotated file Show diff for this revision Revisions of this file
--- a/UbloxATCellularInterface.cpp	Fri Nov 22 19:45:14 2019 +0500
+++ b/UbloxATCellularInterface.cpp	Wed Jan 01 11:47:24 2020 +0500
@@ -1379,6 +1379,28 @@
     return _ip;
 }
 
+// Get the IP address of the on-board modem IP stack.
+nsapi_error_t UbloxATCellularInterface::get_ip_address(SocketAddress *address)
+{
+    address->set_ip_address(this->get_ip_address());
+
+    return NSAPI_ERROR_OK;
+}
+
+nsapi_error_t UbloxATCellularInterface::get_netmask(SocketAddress *address)
+{
+    address->set_ip_address("");
+
+    return NSAPI_ERROR_OK;
+}
+
+nsapi_error_t UbloxATCellularInterface::get_gateway(SocketAddress *address)
+{
+    address->set_ip_address(this->get_ip_address());
+
+    return NSAPI_ERROR_OK;
+}
+
 // Get the local network mask.
 const char *UbloxATCellularInterface::get_netmask()
 {
--- a/UbloxATCellularInterface.h	Fri Nov 22 19:45:14 2019 +0500
+++ b/UbloxATCellularInterface.h	Wed Jan 01 11:47:24 2020 +0500
@@ -233,22 +233,34 @@
      *  @return         Null-terminated representation of the local IP address
      *                  or null if no IP address has been received.
      */
+    MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated")
     virtual const char *get_ip_address();
 
+    /** @copydoc NetworkInterface::get_ip_address */
+    virtual nsapi_error_t get_ip_address(SocketAddress *address);
+
     /** Get the local network mask.
      *
      *  @return         Null-terminated representation of the local network mask
      *                  or null if no network mask has been received.
      */
+    MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated")
     virtual const char *get_netmask();
 
+    /** @copydoc NetworkInterface::get_netmask */
+    virtual nsapi_error_t get_netmask(SocketAddress *address);
+
     /** Get the local gateways.
      *
      *  @return         Null-terminated representation of the local gateway
      *                  or null if no network mask has been received.
      */
+    MBED_DEPRECATED_SINCE("mbed-os-5.15", "String-based APIs are deprecated")
     virtual const char *get_gateway();
 
+    /** @copydoc NetworkInterface::get_gateway */
+    virtual nsapi_error_t get_gateway(SocketAddress *address);
+
     /** Call back in case connection is lost.
      *
      * @param cb     The function to call.