You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api/networkinterfaces/CellularInterface.md
+2-8Lines changed: 2 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,9 @@
2
2
3
3
<spanclass="images"><span>CellularBase class hierarchy</span></span>
4
4
5
-
The CellularBase provides a C++ API for connecting to the internet over a Cellular device.
6
-
7
-
Arm Mbed OS provides a [reference implementation of CellularBase](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_easy_cellular_connection_8h_source.html), which has more information.
8
-
9
-
#### Cellular
10
-
11
5
The [CellularBase](http://os-doc-builder.test.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.
12
6
13
-
Arm Mbed OS provides a [reference implementation of CellularBase](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_easy_cellular_connection_8h_source.html).
7
+
Arm Mbed OS provides a [reference implementation of CellularBase](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_cellular_context_8h_source.html), which has more information.
14
8
15
9
##### Getting started
16
10
@@ -48,7 +42,7 @@ You can use and extend a cellular interface in various different ways. For examp
[`mbed-os-example-cellular`](https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-cellular/) uses [an easy cellular connection](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_easy_cellular_connection_8h_source.html). It depends on the modem whether the application uses PPP or AT mode. We can summarize this particular design as follows:
45
+
[`mbed-os-example-cellular`](https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-cellular/) uses PPP or AT mode depending on the modem. We can summarize this particular design as follows:
52
46
53
47
- It uses an external IP stack, such as LWIP, or on-chip network stacks such as when the modem does not support PPP.
54
48
- The easy cellular connection uses standard 3GPP AT 27.007 AT commands to set up the cellular modem and to register to the network.
Copy file name to clipboardExpand all lines: docs/porting/connectivity/CellularInterface.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ If your cellular module has an IP stack, you need to implement the AT commands t
86
86
87
87
For example implementations of a socket adaptation, look in `features/cellular/framework/targets`.
88
88
89
-
When the modem has AT and/or PPP mode support in place and the application developer has selected which mode to use, it's up to the cellular framework to instantiate the correct classes. For example, [mbed-os-example-cellular](https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-cellular/) instantiates [EasyCellularConnection class](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_easy_cellular_connection_8h_source.html), which in turn instantiates [CellularConnectionFSM class](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_cellular_connection_f_s_m_8h_source.html). CellularConnectionFSM instantiates classes implementing [the AT command layer](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_a_t___cellular_device_8h_source.html) between the modem and the Mbed OS CPU. If an application developer has configured PPP mode in `mbed_app.json` then [AT_CellularNetwork](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_a_t___cellular_network_8h_source.html) connects to a cellular network and calls `nsapi_ppp_connect()` to start the data call through the PPP pipe using LWIP sockets.
89
+
When the modem has AT and/or PPP mode support in place and the application developer has selected which mode to use, it's up to the cellular framework to instantiate the correct classes. For example, [mbed-os-example-cellular](https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-cellular/) instantiates [CellularContext class](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_cellular_context_8h_source.html). CellularContext instantiates classes implementing [the AT command layer](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_a_t___cellular_device_8h_source.html) between the modem and the Mbed OS CPU. If an application developer has configured PPP mode in `mbed_app.json` then [AT_CellularContext](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/_a_t___cellular_context_8h_source.html) connects to a cellular network and calls `nsapi_ppp_connect()` to start the data call through the PPP pipe using LWIP sockets.
Copy file name to clipboardExpand all lines: docs/reference/configuration/Connectivity.md
+7-1Lines changed: 7 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -191,7 +191,7 @@ Example application code can be as simple as:
191
191
if (!net) {
192
192
// There is no default...
193
193
}
194
-
net->connet();
194
+
net->connect();
195
195
```
196
196
197
197
Boards that provide only Ethernet connectivity do not require any configuration. The default settings are sufficient. Boards that provide other connectivity options require selecting the default interface type and providing settings for it.
Copy file name to clipboardExpand all lines: docs/reference/technology/connectivity/cellular.md
+28-10Lines changed: 28 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -27,7 +27,7 @@ There are two phases to Mbed OS connectivity, in general:
27
27
1. Connect to a network.
28
28
1. Open a socket to send or receive data.
29
29
30
-
With cellular, the easiest way to connect your application to the internet over a cellular network is to use the `CellularConnectionFSM` class. 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, as Figure 2 illustrates.
31
31
32
32
<spanclass="images"><span>Figure 2. Connect to cellular network and open a socket</span></span>
33
33
@@ -48,33 +48,51 @@ If you use an Mbed OS target and a separate cellular hosted module via a serial
48
48
[
49
49
"CELLULAR_DEVICE=<manufacturer-module>",
50
50
"MDMRXD=<rx-pin-name>",
51
-
"MDMTXD=<tx-pin-name>"
51
+
"MDMTXD=<tx-pin-name>",
52
+
"MDMRTS=<rts-pin-name>",
53
+
"MDMCTS=<cts-pin-name>"
52
54
]
53
-
}
55
+
}
54
56
55
-
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/CTS connected on UART.
57
+
You need to change the pinnames 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`.
56
58
57
59
### Cellular APIs
58
60
59
-
As an application developer, you should use and refer only to classes located under API folder. All the other classes have implementation details which are expected to change frequently.
61
+
As an application developer, you should use and refer only to classes located under API folder. All the other classes have implementation details that are expected to change frequently.
60
62
61
63
Cellular APIs are structured based on main functionalities:
62
64
63
-
-`CellularNetwork` for cellular network features, such as preferred operator and APN.
65
+
-`CellularContext` is the main interface for the application. You can use it to connect to the operator's Access Point Name (APN).
66
+
-`CellularNetwork` for cellular network features, such as registering and attaching to a network.
64
67
-`CellularPower` for cellular hosted module power control, such as enabling power save.
65
68
-`CellularInformation` to read the cellular hosted module type and firmware version.
66
69
-`CellularSIM` to enter the PIN code and other SIM management functions.
67
70
-`CellularSMS` to read and write SMS messages.
68
71
72
+
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`.
73
+
These values are not defined by default, and you must override them in `mbed_app.json` if you need them:
74
+
75
+
"target_overrides": {
76
+
"*": {
77
+
"nsapi.default-cellular-plmn": "\"12346\"",
78
+
"nsapi.default-cellular-sim-pin": "\"1234\"",
79
+
"nsapi.default-cellular-apn": "\"internet\"",
80
+
"nsapi.default-cellular-username": 0,
81
+
"nsapi.default-cellular-password": 0
82
+
}
83
+
}
84
+
69
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.
70
86
71
87
<spanclass="images"><span>Figure 3. Use CellularDevice to open Cellular APIs</span></span>
72
88
73
89
When an application has opened a cellular API, you can use it to request API methods. For example:
printf("Local IP address is %s", ctx->get_ip_address());
95
+
}
78
96
}
79
97
80
98
### UDP and TCP sockets
@@ -119,7 +137,7 @@ Consider the following points when selecting PPP or AT mode:
119
137
120
138
### Optimize for power consumption
121
139
122
-
The `CellularPower` class has methods to optimize power saving. The `set_powerl_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).
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).
0 commit comments