mbed-ce / mbed-os

Arm Mbed OS is a platform operating system designed for the internet of things
https://mbed.com
Other
79 stars 15 forks source link

Fix CellularInterface functions never being defined #307

Closed multiplemonomials closed 2 months ago

multiplemonomials commented 2 months ago

Summary of changes

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!