Skip to content

Commit b0ec424

Browse files
committed
Cellular: Add back weak CellularInterface::get_default_instance
The enables the cellular call flow below: 1. Weak CellularInterface::get_default_instance (NetworkInterfaceDefaults.cpp) 2. Weak CellularInterface::get_target_default_instance (NetworkInterfaceDefaults.cpp) 3. Weak CellularContext::get_default_instance (CellularContext.cpp) 4. Weak CellularDevice::get_default_instance (CellularDevice.cpp) 5. Weak CellularDevice::get_target_default_instance (CellularDevice.cpp) So that cellular modem driver can override CellularDevice::get_default_instance or CellularDevice::get_target_default_instance to provide actual default instance.
1 parent 0fb002c commit b0ec424

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

connectivity/netsocket/source/NetworkInterfaceDefaults.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,13 @@ MBED_WEAK MeshInterface *MeshInterface::get_default_instance()
4343
return get_target_default_instance();
4444
}
4545

46+
#if MBED_CONF_CELLULAR_PRESENT
47+
MBED_WEAK CellularInterface *CellularInterface::get_default_instance()
48+
{
49+
return get_target_default_instance();
50+
}
51+
#endif // MBED_CONF_CELLULAR_PRESENT
52+
4653
/* For other types, we can provide a reasonable get_target_default_instance
4754
* in some cases. This is done in EthernetInterface.cpp, mbed-mesh-api and
4855
* OnboardCellularInterface.cpp. We have no implementation for WiFi, so a

0 commit comments

Comments
 (0)