1919
2020#include " netsocket/EthInterface.h"
2121#include " netsocket/WiFiInterface.h"
22+ #if MBED_CONF_CELLULAR_PRESENT
2223#include " netsocket/CellularInterface.h"
24+ #endif // MBED_CONF_CELLULAR_PRESENT
2325#include " netsocket/MeshInterface.h"
2426
2527/* Weak default instance static classes for the various abstract classes.
@@ -41,10 +43,12 @@ MBED_WEAK MeshInterface *MeshInterface::get_default_instance()
4143 return get_target_default_instance ();
4244}
4345
46+ #if MBED_CONF_CELLULAR_PRESENT
4447MBED_WEAK CellularInterface *CellularInterface::get_default_instance ()
4548{
4649 return get_target_default_instance ();
4750}
51+ #endif // MBED_CONF_CELLULAR_PRESENT
4852
4953/* For other types, we can provide a reasonable get_target_default_instance
5054 * in some cases. This is done in EthernetInterface.cpp, mbed-mesh-api and
@@ -88,6 +92,7 @@ void WiFiInterface::set_default_parameters()
8892#endif
8993}
9094
95+ #if MBED_CONF_CELLULAR_PRESENT
9196void CellularInterface::set_default_parameters ()
9297{
9398 /* CellularInterface is expected to attempt to work without any parameters - we
@@ -109,6 +114,7 @@ void CellularInterface::set_default_parameters()
109114 set_plmn (MBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN);
110115#endif
111116}
117+ #endif // MBED_CONF_CELLULAR_PRESENT
112118
113119/* Finally the dispatch from the JSON default interface type to the specific
114120 * subclasses. It's our job to configure - the default NetworkInterface is
@@ -147,6 +153,7 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
147153 return MeshInterface::get_default_instance ();
148154}
149155#elif MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == CELLULAR
156+ #if MBED_CONF_CELLULAR_PRESENT
150157MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance ()
151158{
152159 CellularInterface *cellular = CellularInterface::get_default_instance ();
@@ -156,6 +163,7 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
156163 cellular->set_default_parameters ();
157164 return cellular;
158165}
166+ #endif // MBED_CONF_CELLULAR_PRESENT
159167#elif defined(MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE)
160168/* If anyone invents a new JSON value, they must have their own default weak
161169 * implementation.
0 commit comments