mbed-os/connectivity/cellular
Robert Walton a0befae2d4 CMake: Only build unit tests if Mbed OS is the current project
Typically when adding a unit test directory to a CMake project a check
will be used to ensure the subdirectory is added only if the following
are true:

* The BUILD_TESTING option is set to ON.
* The current CMake project is the top-level project.

The reason being, if a downstream project includes our project they
generally don't want to build our unit tests.

In mbed-os, we do correctly specify the above condition before adding
the central UNITTEST subdirectory, which fetches googletest and adds the
"stub" libraries the unit tests depend on. However, we only check if
CMAKE_CROSSCOMPILING is OFF (or undefined) before actually adding the
unit tests. This mismatched logic would lead to unexpected build
failures in various scenarios. One likely case could be: a downstream
project including mbed-os happens to set CMAKE_CROSSCOMPILING to
OFF/undefined for any reason (possibly to build its own unit tests).
mbed-os would go ahead and attempt to build its tests without fetching
googletest or adding the required stub targets.

To fix the issue replace the check for CMAKE_CROSSCOMPILING in the unit
tests with the same BUILD_TESTING idiom we use for adding the central
UNITTESTS subdirectory.
2021-06-10 23:34:14 +01:00
..
include/cellular/framework Add SPDX license identifier to Arm files 2020-10-15 10:47:27 +01:00
source/framework CMake: Rename CMake targets 2020-11-06 17:25:22 +00:00
tests/UNITTESTS Merge pull request #14708 from Patater/fix-test-function-return 2021-05-31 12:20:00 +02:00
.gitignore Move cellular framework into connectivity 2020-07-22 11:05:49 +01:00
CMakeLists.txt CMake: Only build unit tests if Mbed OS is the current project 2021-06-10 23:34:14 +01:00
README.md Remove Cellular dependency in netsocket 2020-12-03 18:16:33 +01:00
mbed_lib.json Remove Cellular dependency in netsocket 2020-12-03 18:16:33 +01:00

README.md

Mbed cellular connectivity

This is the Github repo for Mbed cellular connectivity:

framework/
    API         Application Programming Interface for cellular connectivity
    AT          AT implementation based on 3GPP TS 27.007 specification
    common      Common and utility sources
    device      Implementation of cellular device and state machine
    targets     Vendor specific cellular module adaptations

Note: Application developers should use only the API folder.

Known limitations

Please note that this is a first release of Cellular framework and is subject to further development in future.

Supported modules

You can find currently supported cellular modules in the framework/targets/ folder, where we also add support for new cellular modules.

Cellular configuration

You can change cellular defaults in the mbed_lib.json configuration file.

Debug traces

You can define the debug tracing level in the mbed_app.json configuration file:

"target_overrides": {
    "*": {
        "mbed-trace.enable": true,
        "platform.stdio-convert-newlines": true,
        "platform.stdio-baud-rate": 115200,
        "platform.default-serial-baud-rate": 115200
    }
},
"config": {
    "trace-level": {
        "help": "Options are TRACE_LEVEL_ERROR,TRACE_LEVEL_WARN,TRACE_LEVEL_INFO,TRACE_LEVEL_DEBUG",
        "macro_name": "MBED_TRACE_MAX_LEVEL",
        "value": "TRACE_LEVEL_INFO"
    }
}

Greentea tests

Cellular connectivity can be tested with generic Mbed OS netsocket and network interface tests found in Mbed OS root TESTS directory. For more information, see TESTS/netsocket/README.md and TESTS/network/interface/README.md.

Unit tests

Cellular unit tests are in Mbed OS root UNITTESTS/connectivity/cellular.

Dependency with netsocket

If you create a .mbedignore file with

connectivity/cellular*
connectivity/drivers/cellular*

MBED_CONF_CELLULAR_PRESENT will not be set