Skip to content

Commit 2c5e31a

Browse files
authored
Merge branch 'development' into chip_to_cloud_book
2 parents c5d3ffb + 7a1763c commit 2c5e31a

File tree

28 files changed

+188
-407
lines changed

28 files changed

+188
-407
lines changed

docs.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,6 +353,9 @@
353353
{
354354
"path": "docs/api/networksocket/SocketAddress.md"
355355
},
356+
{
357+
"path": "docs/api/networksocket/CellularNonIPSocket.md"
358+
},
356359
{
357360
"path": "docs/api/networksocket/DNS.md"
358361
},
@@ -771,7 +774,7 @@
771774
{
772775
"title": "Developing: Mbed Studio",
773776
"sources": [{
774-
"url": "https://github.com/ARMmbed/mbed-os-5-docs/blob/5.11/docs/tools/Studio/mbed-studio.md"
777+
"url": "docs/tools/Studio/mbed-studio.md"
775778
}]
776779
},
777780
{
@@ -913,9 +916,6 @@
913916
{
914917
"path": "docs/tutorials/using_apis/flow_control.md"
915918
},
916-
{
917-
"path": "docs/tutorials/using_apis/connectivity/cellular_tcp.md"
918-
},
919919
{
920920
"path": "docs/tutorials/using_apis/connectivity/light-control.md"
921921
},
@@ -993,7 +993,6 @@
993993
"tutorials"
994994
]
995995
},
996-
997996
{
998997
"title": "Contributing",
999998
"description": "",

docs/api/api.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,15 +135,16 @@ The [Mbed OS RTOS](rtos.html) capabilities include managing objects such as thre
135135
<tr>
136136
<td><a href="socket.html">Socket</a></td>
137137
<td><a href="socketaddress.html">SocketAddress</a></td>
138-
<td><a href="dtlssocket.html">DTLSSocket</a></td>
138+
<td><a href="tlssocket.html">TLSSocket</a></td>
139139
</tr>
140140
<tr>
141141
<td><a href="udpsocket.html">UDPSocket</a></td>
142-
<td><a href="dns-resolver.html">DNS Resolver</a></td>
143-
<td><a href="socketstats.html">SocketStats</a></td>
142+
<td><a href="non-ip-cellular-socket.html">Non-IP cellular socket</a></td>
143+
<td><a href="dtlssocket.html">DTLSSocket</a></td>
144144
<tr>
145145
<td><a href="tcpsocket.html">TCPSocket</a></td>
146-
<td><a href="tlssocket.html">TLS Socket</a></td>
146+
<td><a href="dns-resolver.html">DNS resolver</a></td>
147+
<td><a href="socketstats.html">SocketStats</a></td>
147148
</tr>
148149
</tbody>
149150
</table>

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.
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
## Non-IP cellular socket
2+
3+
The CellularNonIPSocket class provides, through standard socket `send` and `recv` member functions, the ability to send and receive 3GPP non-IP datagrams (NIDD) using our cellular IoT feature. This feature is implemented in the [`ControlPlane_netif`](https://os.mbed.com/docs/development/mbed-os-api-doxy/classmbed_1_1_control_plane__netif.html) class.
4+
5+
The constructor takes no parameters. To initialize the socket on a specified NetworkInterface, you must call the `open` method, which takes a CellularContext pointer.
6+
7+
[`CellularContext`](https://os.mbed.com/docs/development/mbed-os-api-doxy/_cellular_context_8h.html) sets up the modem into the Control Plane optimization mode of operation if it is requested and if the cellular network supports it.
8+
9+
Control plane optimization is a new feature for cellular IoT (CIoT). With it, the device can use cellular control channels for data communications, to save power and resources by using less radio signaling.
10+
11+
Note: <span class="notes">**Note:** Non-IP use usually requires integration to a cellular operator messaging service. The service supports a web API to send to and receive the non-IP using devices.</span>
12+
13+
You can request Control Plane optimization mode either with CellularDevice's [`create_context`](https://os.mbed.com/docs/development/mbed-os-api-doxy/classmbed_1_1_cellular_device.html#a43b9e992dff1cb5d880acec576e9d06f) or by configuring it in the cellular `mbed_lib.json`:
14+
15+
```json
16+
{
17+
"name": "cellular",
18+
"config": {
19+
"control-plane-opt": {
20+
"help": "Enables control plane CIoT EPS optimisation",
21+
"value": true
22+
}
23+
}
24+
}
25+
```
26+
27+
### CellularNonIPSocket class reference
28+
29+
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/development/mbed-os-api-doxy/classmbed_1_1_cellular_non_i_p_socket.html)
30+
31+
The following code demonstrates how to create and use a cellular non-IP socket:
32+
33+
```
34+
35+
#include "mbed.h"
36+
#include "CellularNonIPSocket.h"
37+
#include "CellularDevice.h"
38+
39+
// Network interface
40+
NetworkInterface *iface;
41+
42+
int main() {
43+
// Bring up the cellular interface
44+
iface = CellularContext::get_default_nonip_instance();
45+
MBED_ASSERT(iface);
46+
47+
// sim pin, apn, credentials and possible plmn are taken automatically from json when using NetworkInterface::set_default_parameters()
48+
iface->set_default_parameters();
49+
50+
printf("Cellular Non-IP Socket example\n");
51+
if(NSAPI_ERROR_OK != iface->connect() || NSAPI_STATUS_GLOBAL_UP != iface->get_connection_status()) {
52+
printf("Error connecting\n");
53+
return -1;
54+
}
55+
56+
CellularNonIPSocket sock;
57+
58+
nsapi_error_t retcode = sock.open((CellularContext*)iface);
59+
60+
if (retcode != NSAPI_ERROR_OK) {
61+
printf("CellularNonIPSocket.open() fails, code: %d\n", retcode);
62+
return -1;
63+
}
64+
65+
const char *send_string = "TEST";
66+
67+
if(0 > sock.send((void*) send_string, sizeof(send_string))) {
68+
printf("Error sending data\n");
69+
return -1;
70+
}
71+
72+
printf("Success sending data\n");
73+
74+
char recv_buf[4];
75+
if(0 > sock.recv((void *)recv_buf, sizeof(recv_buf))) {
76+
printf("Error receiving data\n");
77+
return -1;
78+
}
79+
80+
printf("Success receiving data\n");
81+
82+
// Close the socket and bring down the network interface
83+
sock.close();
84+
iface->disconnect();
85+
return 0;
86+
}
87+
88+
```

docs/api/networksocket/networksocket.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<h2 id="network-socket">Network socket overview</h2>
22

3-
The application programming interface for IP networking is the Socket API. As described in the [IP networking](../reference/ip-networking.html) section, the Socket API relates to OSI layer 4, the Transport layer. In Mbed OS, the Socket API supports both TCP and UDP protocols.
3+
The application programming interface for IP networking is the Socket API. As described in the [IP networking](../reference/ip-networking.html) section, the Socket API relates to OSI layer 4, the Transport layer. In Mbed OS, the Socket API is abstract and supports various protocols such as TCP, UDP and non-IP data delivery for NB-IoT cellular networks.
44

55
<span class="images">![](https://s3-us-west-2.amazonaws.com/mbed-os-docs-images/ip-networking.png)<span>Sockets</span></span>
66

@@ -97,6 +97,7 @@ The network socket API provides a common interface for using sockets on network
9797
- [UDPSocket](udpsocket.html): This class provides the ability to send packets of data over UDP.
9898
- [TCPSocket](tcpsocket.html): This class provides the ability to send a stream of data over TCP.
9999
- [SocketAddress](socketaddress.html): You can use this class to represent the IP address and port pair of a unique network endpoint.
100+
- [CellularNonIPSocket](cellularnonipsocket.html): This class provides the ability to send and receive 3GPP non-IP datagrams (NIDD) using the cellular IoT feature.
100101
- [Network status](network-status.html): API for monitoring network status changes.
101102
- [DNS resolver](dns-resolver.html): API for resolving DNS names
102103

docs/api/rtos/Kernel.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ The Kernel namespace implements interfaces to attach a function to some kernel e
66

77
[![View code](https://www.mbed.com/embed/?type=library)](https://os.mbed.com/docs/development/mbed-os-api-doxy/namespacertos_1_1_kernel.html)
88

9-
### `get_ms_count()` example
9+
### get_ms_count() example
1010

1111
The function `get_ms_count()` can be used to read the current RTOS kernel millisecond tick count. The below code snippet demonstrates use of the `get_ms_count()` function to calculate the elapsed time:
1212

@@ -26,14 +26,8 @@ void send_data()
2626
2727
```
2828

29-
### `attach_idle_hook()` example
29+
### Kernel hooks example
3030

31-
The function `attach_idle_hook()` can be used to attach a function to be called by the RTOS idle task. The below code snippet demostrates the usage.
32-
33-
[![View Example](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-example-kernel-hooks)](https://github.com/ARMmbed/mbed-os-example-kernel-hooks/blob/master/main.cpp)
34-
35-
### `attach_thread_terminate_hook()` example
36-
37-
The function `attach_thread_terminate_hook()` can be used to attach a function to be called when a thread terminates.
31+
You can use the function `attach_idle_hook()` to attach a function to be called by the RTOS idle task. You can use the function `attach_thread_terminate_hook()` to attach a function to be called when a thread terminates. The below code snippet demostrates the usage of these hooks.
3832

3933
[![View Example](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-example-kernel-hooks)](https://github.com/ARMmbed/mbed-os-example-kernel-hooks/blob/master/main.cpp)

docs/api/storage/FATFileSystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To configure this class, please see the [FileSystem configuration documentation]
3838

3939
### FATFileSystem example
4040

41-
[![View code](https://www.mbed.com/embed/?url=https://github.com/armmbed/mbed-os-example-filesystem)](https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-filesystem/file/54f958b463d0/main.cpp)
41+
[![View code](https://www.mbed.com/embed/?url=https://github.com/armmbed/mbed-os-example-filesystem/)](https://github.com/ARMmbed/mbed-os-example-filesystem/blob/master/main.cpp)
4242

4343
### Related content
4444

docs/api/storage/FileSystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For details regarding how to configure the default file system or override its i
2020

2121
### File system example
2222

23-
[![View code](https://www.mbed.com/embed/?url=https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-filesystem/)](https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-filesystem/file/bc8560ba955d/main.cpp)
23+
[![View code](https://www.mbed.com/embed/?url=https://github.com/ARMmbed/mbed-os-example-filesystem/)](https://github.com/ARMmbed/mbed-os-example-filesystem/blob/master/main.cpp)
2424

2525
### Sector requirements
2626

docs/api/storage/LittleFileSystem.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ To configure this class, please see the [FileSystem configuration documentation]
4545

4646
### LittleFileSystem example
4747

48-
[![View code](https://www.mbed.com/embed/?url=https://github.com/armmbed/mbed-os-example-filesystem)](https://os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-filesystem/file/54f958b463d0/main.cpp)
48+
[![View code](https://www.mbed.com/embed/?url=https://github.com/armmbed/mbed-os-example-filesystem/)](https://github.com/ARMmbed/mbed-os-example-filesystem/blob/master/main.cpp)
4949

5050
### Related content
5151

0 commit comments

Comments
 (0)