Skip to content

Commit 24266b5

Browse files
committed
CellularBase -> CellularInterface tidy
Remove remaining references to deprecated CellularBase in code, avoiding one warning. Optimise by removing separate virtual function entries for NetworkInterface::cellularBase and NetworkInterface::cellularInterface
1 parent 6b84b14 commit 24266b5

File tree

3 files changed

+15
-24
lines changed

3 files changed

+15
-24
lines changed

features/netsocket/CellularInterface.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,14 +116,6 @@ class CellularInterface: public NetworkInterface {
116116
*/
117117
virtual const char *get_gateway() = 0;
118118

119-
/** @copydoc NetworkInterface::cellularBase
120-
*/
121-
MBED_DEPRECATED_SINCE("mbed-os-5.12", "Migrated to CellularInterface")
122-
virtual CellularInterface *cellularBase()
123-
{
124-
return this;
125-
}
126-
127119
/** @copydoc NetworkInterface::cellularInterface
128120
*/
129121
virtual CellularInterface *cellularInterface()

features/netsocket/NetworkInterface.h

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class NetworkInterface: public DNS {
5151
* target.network-default-interface-type or other overrides.
5252
*
5353
* The type of the interface returned can be tested by calling ethInterface(),
54-
* wifiInterface(), meshInterface(), cellularBase(), emacInterface() and checking
54+
* wifiInterface(), meshInterface(), cellularInterface(), emacInterface() and checking
5555
* for NULL pointers.
5656
*
5757
* The default behavior is to return the default interface for the
@@ -341,12 +341,19 @@ class NetworkInterface: public DNS {
341341
/** Return pointer to a CellularInterface.
342342
* @return Pointer to requested interface type or NULL if this class doesn't implement the interface.
343343
*/
344-
MBED_DEPRECATED_SINCE("mbed-os-5.12", "Migrated to CellularInterface")
345-
virtual CellularInterface *cellularBase()
344+
virtual CellularInterface *cellularInterface()
346345
{
347346
return 0;
348347
}
349348

349+
/** Return pointer to a CellularBase.
350+
* @return Pointer to requested interface type or NULL if this class doesn't implement the interface.
351+
*/
352+
MBED_DEPRECATED_SINCE("mbed-os-5.12", "Migrated to CellularInterface")
353+
CellularInterface *cellularBase() {
354+
return cellularInterface();
355+
}
356+
350357
/** Return pointer to an EMACInterface.
351358
* @return Pointer to requested interface type or NULL if this class doesn't implement the interface.
352359
*/
@@ -415,14 +422,6 @@ class NetworkInterface: public DNS {
415422
* configuration).
416423
*/
417424
virtual void set_default_parameters();
418-
419-
/** Return pointer to a CellularInterface.
420-
* @return Pointer to requested interface type or NULL if this class doesn't implement the interface.
421-
*/
422-
virtual CellularInterface *cellularInterface()
423-
{
424-
return 0;
425-
}
426425
};
427426

428427
#endif

features/netsocket/NetworkInterfaceDefaults.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
#include "EthInterface.h"
2020
#include "WiFiInterface.h"
21-
#include "CellularBase.h"
21+
#include "CellularInterface.h"
2222
#include "MeshInterface.h"
2323

2424
/* Weak default instance static classes for the various abstract classes.
@@ -40,7 +40,7 @@ MBED_WEAK MeshInterface *MeshInterface::get_default_instance()
4040
return get_target_default_instance();
4141
}
4242

43-
MBED_WEAK CellularBase *CellularBase::get_default_instance()
43+
MBED_WEAK CellularInterface *CellularInterface::get_default_instance()
4444
{
4545
return get_target_default_instance();
4646
}
@@ -87,9 +87,9 @@ void WiFiInterface::set_default_parameters()
8787
#endif
8888
}
8989

90-
void CellularBase::set_default_parameters()
90+
void CellularInterface::set_default_parameters()
9191
{
92-
/* CellularBase is expected to attempt to work without any parameters - we
92+
/* CellularInterface is expected to attempt to work without any parameters - we
9393
* will try, at least.
9494
*/
9595
#ifdef MBED_CONF_NSAPI_DEFAULT_CELLULAR_APN
@@ -148,7 +148,7 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
148148
#elif MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == CELLULAR
149149
MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
150150
{
151-
CellularBase *cellular = CellularBase::get_default_instance();
151+
CellularInterface *cellular = CellularInterface::get_default_instance();
152152
if (!cellular) {
153153
return NULL;
154154
}

0 commit comments

Comments
 (0)