In Mbed CE, the MBED_CONF_CELLULAR_PRESENT define is defined only by linking to the mbed-cellular library (compared to old Mbed OS, where it was defined globally for the entire OS, which was... not good). NetworkInterfaceDefaults.cpp tried to use this define, but it's likely to be undefined there, since mbed-cellular is not guaranteed to be linked to this library.
This PR moves this function to mbed-cellular, where MBED_CONF_CELLULAR_PRESENT is guaranteed to be defined. This fixes the "Undefined reference to vtable for CellularInterface" link error that it was possible to get.
NOTE: Even after this PR, mbed-cellular may still fail to link with an undefined reference due to #304. That issue has its own workaround, check there for details.
Impact of changes
Migration actions required
Documentation
Pull request type
[X] Patch update (Bug fix / Target update / Docs update / Test update / Refactor)
[] Feature update (New feature / Functionality change / New API)
[] Major update (Breaking change E.g. Return code change / API behaviour change)
Test results
[] No Tests required for this change (E.g docs only update)
[] Covered by existing mbed-os tests (Greentea or Unittest)
[X] Tests / results supplied as part of this PR
With the workaround for #304 plus this patch, I can now successfully link a program that uses mbed-cellular!
Summary of changes
In Mbed CE, the
MBED_CONF_CELLULAR_PRESENT
define is defined only by linking to thembed-cellular
library (compared to old Mbed OS, where it was defined globally for the entire OS, which was... not good). NetworkInterfaceDefaults.cpp tried to use this define, but it's likely to be undefined there, since mbed-cellular is not guaranteed to be linked to this library.This PR moves this function to
mbed-cellular
, where MBED_CONF_CELLULAR_PRESENT is guaranteed to be defined. This fixes the "Undefined reference to vtable for CellularInterface" link error that it was possible to get.NOTE: Even after this PR,
mbed-cellular
may still fail to link with an undefined reference due to #304. That issue has its own workaround, check there for details.Impact of changes
Migration actions required
Documentation
Pull request type
Test results
With the workaround for #304 plus this patch, I can now successfully link a program that uses mbed-cellular!