Skip to content

Commit 40ac63e

Browse files
author
Ari Parkkila
committed
Cellular docs updated
1 parent 42ffc90 commit 40ac63e

File tree

8 files changed

+42
-89
lines changed

8 files changed

+42
-89
lines changed

docs/api/networkinterfaces/CellularInterface.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
<h2 id="cellular-api">Cellular</h2>
1+
<h2 id="cellular-api">Cellular API</h2>
22

3-
<span class="images">![](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_base.png)<span>CellularBase class hierarchy</span></span>
3+
<span class="images">![](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_interface.png)<span>CellularInterface class hierarchy</span></span>
44

5-
The [CellularBase](https://os.mbed.com/docs/development/mbed-os-api-doxy/_cellular_base_8h_source.html) provides a C++ API for connecting to the internet over a Cellular device.
6-
7-
Arm Mbed OS provides a [reference implementation of CellularBase](https://os.mbed.com/docs/development/mbed-os-api-doxy/_cellular_context_8h_source.html), which has more information.
5+
The [CellularInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_interface.html) class provides a C++ API for connecting to the internet over a Cellular device.
86

97
##### Getting started
108

@@ -48,15 +46,15 @@ You can use and extend a cellular interface in various different ways. For examp
4846
- The easy cellular connection uses standard 3GPP AT 27.007 AT commands to set up the cellular modem and to register to the network.
4947
- After registration, the driver opens a PPP pipe using LWIP with the cellular modem and connects to the internet. If AT only mode is in use, then modem-specific AT commands are used for socket data control.
5048

51-
### CellularBase class reference
49+
### CellularInterface class reference
5250

53-
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_base.html)
51+
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_interface.html)
5452

5553
### Usage
5654

5755
To bring up the network interface:
5856

59-
1. Instantiate an implementation of the CellularBase class.
57+
1. Instantiate an implementation of the CellularInterface class.
6058
1. Call the `connect(pincode, apn)` function with a PIN code for your SIM card and an APN for your network.
6159
1. Once connected, you can use Mbed OS [network sockets](network-socket.html) as usual.
6260

@@ -69,6 +67,6 @@ This example establishes connection with the cellular network using Mbed OS Cell
6967
### Related content
7068

7169
- [Network socket](network-socket.html) API reference overview.
72-
- [Cellular architecture](../reference/cellular.html).
70+
- [Cellular overview](../reference/cellular.html) describes cellular architecture and its usage in more detail.
7371
- [Cellular TCP sockets example](../tutorials/cellular-tcp-sockets.html).
7472
- [Cellular configuration documentation](../reference/configuration-connectivity.html).

docs/api/networkinterfaces/networkinterface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Applications may also ask for a specific type of connection, as the following ta
7979
|`*WiFiInterface::get_default_instance()`| Wi-Fi interface | Requires security parameters (mode, SSID, password). |
8080
|`*EthInterface::get_default_instance()` | Wired Ethernet interface, not Wi-Fi | none |
8181
|`*MeshInterface::get_default_instance()` | Returns either `LoWPANNDInterface` or `ThreadInterface`, depending on which is set to default | Target provides a driver or macro `DEVICE_802_15_4_PHY` is enabled. |
82-
| `*CellularBase::get_default_instance()` | Return cellular connectivity | Requires network parameters (pin, APN, username, password). |
82+
| `*CellularInterface::get_default_instance()` | Return cellular connectivity | Requires network parameters (pin, APN, username, password). |
8383
| `*NetworkInterface::get_default_instance()` | One of the above, depending on `target.network-default-interface-type`. | |
8484

8585
Note that the calls for a specific interface type do not preconfigure credentials such as SSID because an interface-type-specific application is expected to configure these in code. `NULL` is returned if no interface of that type is available.

docs/porting/connectivity/CellularInterface.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
## Cellular module porting
1+
## Cellular device porting
22

3-
This document provides guidelines how to make a cellular modem adaptation for Mbed OS. Please see [Cellular API usage](../apis/cellular-api.html) about how to use cellular modules from an application point of view.
3+
This document provides guidelines how to make a cellular device adaptation for Mbed OS.
44

5-
### Adding modem target support
5+
### Adding cellular on an Mbed OS target
66

77
For new targets, you may need to modify [targets.json](../reference/adding-and-configuring-targets.html), which defines all the target platforms that Mbed OS supports. If Mbed OS supports your specific target, an entry for your target is in this file. To tell the Mbed OS build configuration that your target board has an onboard cellular module, you need to define `modem_is_on_board` and `modem_data_connection_type`.
88

@@ -56,9 +56,9 @@ typedef enum {
5656

5757
```
5858

59-
### Adding a new cellular target
59+
### Adding a new cellular device
6060

61-
You need to specify in [CellularTargets.h](https://os.mbed.com/docs/development/mbed-os-api-doxy/_cellular_targets_8h_source.html) the `<manufacturer-module>` that is mounted on your board.
61+
You need to specify in [CellularTargets.h](https://os.mbed.com/docs/development/mbed-os-api-doxy/_cellular_targets_8h_source.html) the `<manufacturer-module>` mounted on your board.
6262

6363
```target
6464

docs/porting/connectivity/NetworkStack.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Please refer to the [IP networking architecture](../reference/ip-networking.html
1414

1515
#### NetworkInterface Class
1616

17-
The current NetworkInterface subclasses are [CellularInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_base.html), [EthernetInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_eth_interface.html), [MeshInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_mesh_interface.html) and [WiFiInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_wi_fi_interface.html). Your communication interface is a subclass of one of these, as well as the NetworkStack. For example, the [ESP8266Interface](https://github.com/ARMmbed/esp8266-driver) inheritance structure looks like this:
17+
The current NetworkInterface subclasses are [CellularInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_interface.html), [EthernetInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_eth_interface.html), [MeshInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_mesh_interface.html) and [WiFiInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_wi_fi_interface.html). Your communication interface is a subclass of one of these, as well as the NetworkStack. For example, the [ESP8266Interface](https://github.com/ARMmbed/esp8266-driver) inheritance structure looks like this:
1818

1919
<span class="images">![](https://s3-us-west-2.amazonaws.com/mbed-os-docs-images/esp-class.png)<span>Class</span></span>
2020

docs/porting/connectivity/connectivity.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The **DeviceInterface** should also inherit one of the following (unless it is a
1212

1313
- [EthInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_eth_interface.html).
1414
- [WiFiInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_wi_fi_interface.html).
15-
- [CellularInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_base.html).
15+
- [CellularInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_cellular_interface.html).
1616
- [MeshInterface](https://os.mbed.com/docs/development/mbed-os-api-doxy/class_mesh_interface.html).
1717

1818
The **NetworkInterface** implementation provides the following methods:

docs/reference/configuration/Connectivity.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,11 @@ Boards that provide only Ethernet connectivity do not require any configuration.
198198

199199
Select the default interface type by using one of the following `target.network-default-interface-type` parameters:
200200

201-
| `target.network-default-interface-type` | Required configuration |
201+
| `target.network-default-interface-type` | Configuration parameters |
202202
|-----------------------------------------|------------------------|
203203
| `ETHERNET` | nothing |
204204
| `WIFI` | `nsapi.default-wifi-security`, `nsapi.default-wifi-ssid` and `nsapi.default-wifi-password` |
205-
| `CELLULAR` | `nsapi.default-cellular-apn`, `nsapi.default-cellular-username` and `nsapi.default-cellular-password` |
205+
| `CELLULAR` | `nsapi.default-cellular-sim-pin`, `nsapi.default-cellular-apn`, `nsapi.default-cellular-username` and `nsapi.default-cellular-password`, `nsapi.default-cellular-plmn` |
206206
| `MESH` | `nsapi.default-mesh-type` |
207207

208208
```
@@ -223,9 +223,6 @@ Name: nsapi.default-wifi-ssid
223223
Name: nsapi.default-wifi-password
224224
Defined by: library:nsapi
225225
No value set
226-
Name: nsapi.default-cellular-plmn
227-
Defined by: library:nsapi
228-
No value set
229226
Name: nsapi.default-cellular-sim-pin
230227
Defined by: library:nsapi
231228
No value set
@@ -238,6 +235,9 @@ Name: nsapi.default-cellular-password
238235
Name: nsapi.default-cellular-username
239236
Defined by: library:nsapi
240237
No value set
238+
Name: nsapi.default-cellular-plmn
239+
Defined by: library:nsapi
240+
No value set
241241
Name: nsapi.default-mesh-type
242242
Defined by: library:nsapi
243243
Macro name: MBED_CONF_NSAPI_DEFAULT_MESH_TYPE

docs/reference/technology/connectivity/cellular.md

Lines changed: 22 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## Cellular
1+
## Cellular networking
22

33
Mbed OS cellular provides your IoT application with access to world-wide operator-maintained cellular networks, both IP and non-IP, as Figure 1 illustrates. Mbed OS cellular implementation is based on international 3GPP and OMA standards, and it has been verified to work with all cellular networks such as NB-IoT, CAT-M1, 4G LTE, 3G WCDMA and GPRS.
44

@@ -12,49 +12,30 @@ Key features of the Mbed OS cellular APIs include:
1212

1313
- Compatible with 3GPP TS 27.007 and 27.005.
1414
- Implements core functionality for OMA Lightweight M2M Client.
15-
- Hosted cellular modules on Mbed Enabled boards.
15+
- Supports many Mbed Enabled cellular boards.
1616

1717
3GPP TS 27.007 and 27.005 are standards to provide consistent cellular network data connectivity and SMS over an AT command interface for cellular devices, regardless of the underlying cellular network.
1818

1919
OMA Lightweight M2M is a protocol from the Open Mobile Alliance for IoT device management. The Mbed OS cellular API provides core functionality to implement the LWM2M Client. For more information, please see _OMA LightweightM2M_ and _OMA LWM2M Object Connectivity Management_ at [OMA Specifications](http://openmobilealliance.org/wp/index.html).
2020

21-
Mbed OS already supports several Mbed Enabled boards with on-board cellular hosted modules. Because Mbed OS is an open source platform, developers can enable support for new cellular boards with our adaptation framework. Please see our [cellular porting guide](../porting/porting-connectivity.html#cellularinterface) for more information.
21+
Many Mbed Enabled boards already support cellular connectivity. Because Mbed OS is an open source platform, developers can enable support for new cellular boards with our adaptation framework. Please see our [cellular porting guide](../porting/cellular-module-porting.html) for more information.
2222

2323
### Quick start
2424

25-
There are two phases to Mbed OS connectivity, in general:
25+
To use cellular data connection:
2626

2727
1. Connect to a network.
2828
1. Open a socket to send or receive data.
2929

30-
With cellular, the easiest way to connect your application to the internet over a cellular network is to use the `CellularContext` class and `get_default_instance`. It encapsulates most of the complexity of connecting to the cellular network and also reports any changes in connection status to your application. When connected to a cellular network, you can use Mbed OS network sockets as usual, as Figure 2 illustrates.
30+
With cellular, the easiest way to connect your application to the internet over a cellular network is to use the `CellularContext` class and `get_default_instance`. It encapsulates most of the complexity of connecting to the cellular network and also reports any changes in connection status to your application. When connected to a cellular network, you can use Mbed OS network sockets as usual.
3131

32-
<span class="images">![](https://s3-us-west-2.amazonaws.com/mbed-os-docs-images/api-cellular-quick-start.png)<span>Figure 2. Connect to cellular network and open a socket</span></span>
32+
A network interface instantiated directly or using calls such as `CellularInterface::get_default_instance()` or `CellularContext::get_default_instance()` is initially unconfigured. You can call `NetworkInterface::set_default_parameters()` to set the default parameters that would have been set if the interface had been requested using `NetworkInterface::get_default_instance()`.
3333

3434
If you want to see code, you can go to our [cellular example](https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-cellular/).
3535

36-
### Cellular hosted module
36+
### Cellular device selection
3737

38-
If you are using an Mbed OS target that has a supported on-board (mounted) cellular hosted module then cellular framework decides the correct cellular hosted module at compile-time. You can run `mbedls` to find out your current Mbed OS target and then match that to the supported targets in the `CellularTargets.h` file, where a CELLULAR_DEVICE macro is defined based on the Mbed OS target definition and can be used as a C++ class type to instantiate a driver class (inherited from `CellularDevice.h`).
39-
40-
You can browse `CellularTargets.h` file to find out if the hosted module you are using is already supported. In case the hosted module is not yet supported, you could adapt some existing driver for your needs.
41-
42-
Some Mbed OS target boards may have several different kind of cellular hosted modules on-board. In that case, the cellular hosted module driver detects at runtime the actual hosted module that is currently mounted and adapts to that specific cellular hosted module during runtime.
43-
44-
If you use an Mbed OS target and a separate cellular hosted module via a serial line (UART), you need to configure in your `mbed_app.json` configuration file which cellular hosted module to use and which UART pins are connected between the Mbed OS target board and the cellular hosted module:
45-
46-
{
47-
"macros":
48-
[
49-
"CELLULAR_DEVICE=<manufacturer-module>",
50-
"MDMRXD=<rx-pin-name>",
51-
"MDMTXD=<tx-pin-name>",
52-
"MDMRTS=<rts-pin-name>",
53-
"MDMCTS=<cts-pin-name>"
54-
]
55-
}
56-
57-
You need to change the pin names above to actual pins, such as D0 and D1, according to your Mbed target. You may also need to define MDMRTS and MDMCTS pins if you have RTS and CTS connected on UART. If RTC and CTS are not connected on UART, then define MDMRTS and MDMCTS as `NC`.
38+
If an Mbed OS target board has an on-board cellular device then the cellular framework uses that by default when calling `get_default_instance()`. The default cellular device instance can be overridden in the cellular driver `mbed_lib.json` files or an application can override `NetworkInterface::get_default_instance()`.
5839

5940
### Cellular APIs
6041

@@ -64,14 +45,12 @@ Cellular APIs are structured based on main functionalities:
6445

6546
- `CellularContext` is the main interface for the application. You can use it to connect to the operator's Access Point Name (APN).
6647
- `CellularNetwork` for cellular network features, such as registering and attaching to a network.
67-
- `CellularPower` for cellular hosted module power control, such as enabling power save.
68-
- `CellularInformation` to read the cellular hosted module type and firmware version.
69-
- `CellularSIM` to enter the PIN code and other SIM management functions.
48+
- `CellularInformation` to read the cellular device and SIM information.
7049
- `CellularSMS` to read and write SMS messages.
7150

7251
You can instantiate the CellularContext class with `CellularContext::get_default_instance()`, which opens `CellularDevice` and, through the device, opens `CellularContext`. Opening `CellularContext` through `get_default_instance` uses values from `mbed_app.json`.
7352
These values are not defined by default, and you must override them in `mbed_app.json` if you need them:
74-
53+
```
7554
"target_overrides": {
7655
"*": {
7756
"nsapi.default-cellular-plmn": "\"12346\"",
@@ -81,25 +60,21 @@ These values are not defined by default, and you must override them in `mbed_app
8160
"nsapi.default-cellular-password": 0
8261
}
8362
}
84-
85-
The CellularDevice class encloses cellular APIs. Therefore, to use any cellular API, you need to get CellularDevice first. You can then use CellularDevice to open and close cellular APIs, as Figure 3 illustrates.
86-
87-
<span class="images">![](https://s3-us-west-2.amazonaws.com/mbed-os-docs-images/api-cellular-device.png)<span>Figure 3. Use CellularDevice to open Cellular APIs</span></span>
63+
```
64+
The CellularDevice class encloses cellular APIs. Therefore, to use a cellular API, you need to get CellularDevice first. You can then use CellularDevice to open and close cellular APIs.
8865

8966
When an application has opened a cellular API, you can use it to request API methods. For example:
90-
67+
```
9168
CellularContext *ctx = cellularDevice->create_context();
9269
if (ctx) {
93-
if (ctx-connect() == NSAPI_ERROR_OK) {
94-
printf("Local IP address is %s", ctx->get_ip_address());
95-
}
70+
if (ctx->connect() == NSAPI_ERROR_OK) {
71+
printf("Local IP address is %s", ctx->get_ip_address());
72+
}
9673
}
97-
74+
```
9875
### UDP and TCP sockets
9976

100-
If you want to use UDP or TCP sockets, you need an IP stack. Mbed OS cellular has an option to use either the LWIP stack, which is part of Mbed OS, or to use the IP stack on the cellular hosted module. Figure 4 illustrates IP stack deployment.
101-
102-
<span class="images">![](https://s3-us-west-2.amazonaws.com/mbed-os-docs-images/api-cellular-ip-stack.png)<span>Figure 4. IP stack can be used in PPP or AT mode</span></span>
77+
If you want to use UDP or TCP sockets, you need an IP stack. Mbed OS cellular has an option to use either the LWIP stack (PPP mode), which is part of Mbed OS, or to use the IP stack on the cellular device (AT mode).
10378

10479
#### PPP mode with the LWIP stack on Mbed OS
10580

@@ -128,7 +103,7 @@ The AT mode is enabled when the PPP mode is not enabled:
128103

129104
Consider the following points when selecting PPP or AT mode:
130105

131-
- Your cellular hosted module may support only AT or PPP mode.
106+
- A cellular device may support only AT or PPP mode.
132107
- PPP mode supports both UDP and TCP sockets.
133108
- PPP mode does not allow AT commands after connecting to data mode.
134109
- PPP mode uses the LWIP stack, which uses memory from your Mbed OS application.
@@ -137,11 +112,11 @@ Consider the following points when selecting PPP or AT mode:
137112

138113
### Optimize for power consumption
139114

140-
The `CellularPower` class has methods to optimize power saving. The `set_power_level()` offers flexibility to control the reception and transmission power levels. In addition, 3GPP has specified advanced power optimizations that are useful for celluar IoT devices: Power Save Mode (PSM) and extended Discontinuous Reception (eDRX).
115+
The cellular API has methods to optimize power saving: Power Save Mode (PSM) and extended Discontinuous Reception (eDRX).
141116

142117
#### PSM - Power Save Mode
143118

144-
opt_power_save_mode(int periodic_time, int active_time)
119+
set_power_save_mode(int periodic_time, int active_time)
145120

146121
The new 4G modems implementing specifications release 13 and later include PSM. PSM allows the application to tell the modem and network that it does not expect any data in a given time interval, the `periodic_time`. The modem and network can optimize the sleep state and network resource reservations based on this information. During the PSM time, nothing can contact the device from the network side. The application can still send at any time. PSM time can be hours, days or weeks.
147122

@@ -153,7 +128,7 @@ PSM configuration is negotiated with the network, and the actual PSM time that n
153128

154129
#### eDRX - extended Discontinuous Reception
155130

156-
opt_receive_period(int mode, EDRXAccessTechnology act_type, uint8_t edrx_value)
131+
set_receive_period(int mode, EDRXAccessTechnology act_type, uint8_t edrx_value)
157132

158133
eDRX tells how long the device sleeps in continuous connection. The device needs to be able to receive data, but it can tell the network that it checks for incoming messages, for example only every 200 seconds. It can receive messages but only at the given times to allow battery saving sleep periods. These time values are greatly extended compared to normal 4G data transmission – hence the name.
159134

0 commit comments

Comments
 (0)