The Cellular Interface library exposes the capabilities of a few popular cellular modems through a uniform API. Currently, this project contains libraries for these three cellular modems.
The current version of the Cellular Interface library encapsulates the TCP stack offered by those cellular modems. They all implement the same uniform Cellular Interface library API. That API hides the complexity of AT commands, and exposes a socket-like interface to C programmers.
Even though applications can choose to use the Cellular Interface API directly, it is not designed for this purpose. In a typical FreeRTOS system, applications use higher level libraries, such as the coreMQTT library and the coreHTTP library, to communicate with other end points. These higher level libraries use an abstract interface, the Transport Interface, to send and receive data. A Transport Interface can be implemented on top of the Cellular Interface library; the Cellular Interface Demo uses such an implementation.
Most cellular modems implement more or less of the AT commands defined by the 3GPP TS v27.007 standard. This project provides an implementation of such standard AT commands in a reusable common component. The three Cellular Interface libraries in this project all take advantage of that common code. The library for each modem only implements the vendor-specific AT commands, then exposes the complete Cellular Interface library API.
The common component that implements the 3GPP TS v27.007 standard has been written in compliance with the following code quality criteria:
- GNU Complexity scores are not over 8
- MISRA C:2012 coding standard. Any deviations from the standard are documented in source code comments marked by "coverity".
There is no direct dependency for the Cellular Interface library. However, Ethernet, Wi-Fi and cellular cannot co-exist in the FreeRTOS network stack. Developers must choose one of the network interface to integrate with the Secure Sockets library.
For information about porting the Cellular Interface library to your platform, see Porting the Cellular Interface library in the FreeRTOS Porting Guide.
Code Size of cellular interface library (example generated with GCC for ARM Cortex-M) | File | With -O1 Optimization | With -Os Optimization |
---|---|---|---|
cellular_3gpp_api.c | 6.3K | 5.7K | |
cellular_3gpp_urc_handler.c | 0.9K | 0.8K | |
cellular_at_core.c | 1.4K | 1.2K | |
cellular_common_api.c | 0.5K | 0.5K | |
cellular_common.c | 1.6K | 1.4K | |
cellular_pkthandler.c | 1.4K | 1.2K | |
cellular_pktio.c | 1.8K | 1.6K | |
Total estimates | 13.9K | 12.4K |
The source code can be downloaded as part of the FreeRTOS libraries or by itself.
To clone the library from Github using HTTPS:
git clone https://github.com/FreeRTOS/FreeRTOS-Cellular-Interface.git
Using SSH:
git clone [email protected]:FreeRTOS/FreeRTOS-Cellular-Interface.git
At the root of this repository you will see these folders:
source
: reusable common code that implements the standard AT commands defined by 3GPP TS v27.007modules
: vendor-specific code that implements non-3GPP AT commands for each cellular modemdoc
: documentationtest
: unit test and cbmctools
: tools for Coverity static analysis and CMock
The Cellular Interface library should be built as part of an application. In order to do this, you must provide certain configurations. The FreeRTOS_Cellular_Interface_Windows_Simulator project provides an example of how to configure the build. More information can be found in the Cellular API References.
Please refer to the Cellular Interface page for more information.
The Cellular Interface library runs on MCUs using an abstracted interface, the Comm Interface, to communicate with cellular modems. A Comm Interface must be implemented on the MCU platform as well. The most common implementations of the Comm Interface communicate over UART hardware, but can be implemented over other physical interfaces, such as SPI, as well. The documentation for the Comm Interface can be found in the Cellular Library API References. The following example implementations of the Comm Interface are available: