19
19
20
20
#include " netsocket/EthInterface.h"
21
21
#include " netsocket/WiFiInterface.h"
22
+ #if MBED_CONF_CELLULAR_PRESENT
22
23
#include " netsocket/CellularInterface.h"
24
+ #endif // MBED_CONF_CELLULAR_PRESENT
23
25
#include " netsocket/MeshInterface.h"
24
26
25
27
/* Weak default instance static classes for the various abstract classes.
@@ -41,10 +43,12 @@ MBED_WEAK MeshInterface *MeshInterface::get_default_instance()
41
43
return get_target_default_instance ();
42
44
}
43
45
46
+ #if MBED_CONF_CELLULAR_PRESENT
44
47
MBED_WEAK CellularInterface *CellularInterface::get_default_instance ()
45
48
{
46
49
return get_target_default_instance ();
47
50
}
51
+ #endif // MBED_CONF_CELLULAR_PRESENT
48
52
49
53
/* For other types, we can provide a reasonable get_target_default_instance
50
54
* in some cases. This is done in EthernetInterface.cpp, mbed-mesh-api and
@@ -88,6 +92,7 @@ void WiFiInterface::set_default_parameters()
88
92
#endif
89
93
}
90
94
95
+ #if MBED_CONF_CELLULAR_PRESENT
91
96
void CellularInterface::set_default_parameters ()
92
97
{
93
98
/* CellularInterface is expected to attempt to work without any parameters - we
@@ -109,6 +114,7 @@ void CellularInterface::set_default_parameters()
109
114
set_plmn (MBED_CONF_NSAPI_DEFAULT_CELLULAR_PLMN);
110
115
#endif
111
116
}
117
+ #endif // MBED_CONF_CELLULAR_PRESENT
112
118
113
119
/* Finally the dispatch from the JSON default interface type to the specific
114
120
* subclasses. It's our job to configure - the default NetworkInterface is
@@ -147,6 +153,7 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
147
153
return MeshInterface::get_default_instance ();
148
154
}
149
155
#elif MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE == CELLULAR
156
+ #if MBED_CONF_CELLULAR_PRESENT
150
157
MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance ()
151
158
{
152
159
CellularInterface *cellular = CellularInterface::get_default_instance ();
@@ -156,6 +163,7 @@ MBED_WEAK NetworkInterface *NetworkInterface::get_target_default_instance()
156
163
cellular->set_default_parameters ();
157
164
return cellular;
158
165
}
166
+ #endif // MBED_CONF_CELLULAR_PRESENT
159
167
#elif defined(MBED_CONF_TARGET_NETWORK_DEFAULT_INTERFACE_TYPE)
160
168
/* If anyone invents a new JSON value, they must have their own default weak
161
169
* implementation.
0 commit comments