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/light-control.md
+22-22Lines changed: 22 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
<h1id="light-control">Light control tutorial</h1>
1
+
<h2id="light-control">Light control tutorial</h2>
2
2
3
3
The application below demonstrates a simple light control application, where devices can control the LED status of all devices in the network. You can build the application for the unsecure 6LoWPAN-ND or Thread network.
4
4
5
-
## Download the application
5
+
###Download the application
6
6
7
7
```
8
8
mbed import mbed-os-example-mesh-minimal
@@ -13,11 +13,11 @@ Or click `Import into Mbed IDE` in the example below:
By default, the Thread application uses the static network link configuration defined in the [mesh API configuration file](https://github.com/ARMmbed/mbed-os/blob/master/features/nanostack/mbed-mesh-api/mbed_lib.json).
92
92
If you want to commission a Thread device, see [how to commission a Thread device in practice](../reference/thread-tech.html#thread-commissioning).
@@ -100,7 +100,7 @@ The Thread stack learns the network settings from the commissioning process and
100
100
- Commission the device to the Thread network.
101
101
- When you restart the device next time, the device reads the Thread configuration settings from the SD card and tries to attach to an existing network.
102
102
103
-
## Requirements for hardware
103
+
###Requirements for hardware
104
104
105
105
The networking stack in this example requires TLS functionality to be enabled on Mbed TLS. On devices where hardware entropy is not present, TLS is disabled by default. This results in compile time failures or linking failures.
106
106
@@ -110,7 +110,7 @@ See [Notes on different hardware](https://github.com/ARMmbed/mbed-os-example-mes
110
110
111
111
You also need to check how LEDs and buttons are configured for your hardware, and update the `.json` file accordingly.
112
112
113
-
## Changing the radio driver
113
+
###Changing the radio driver
114
114
115
115
To run a 6LoWPAN-ND network, you need a working RF driver for Nanostack. This example uses the Atmel AT86RF233 by default.
116
116
@@ -121,23 +121,23 @@ To change the RF driver, modify the `mbed_app.json` file by setting preferred RF
121
121
"mcr20a.provide-default": true
122
122
```
123
123
124
-
## Compile the application
124
+
###Compile the application
125
125
126
126
```
127
127
mbed compile -m K64F -t GCC_ARM
128
128
```
129
129
130
130
A binary is generated in the end of the build process.
131
131
132
-
## Connect the RF shield to the board
132
+
###Connect the RF shield to the board
133
133
134
134
This example uses the Atmel AT86RF233, which you can [purchase](https://firefly-iot.com/product/firefly-arduino-shield-2-4ghz/). Place the shield on top of your board, and power it on.
135
135
136
-
## Program the target
136
+
###Program the target
137
137
138
138
Drag and drop the binary to the target to program the application.
139
139
140
-
## Update the firmware of the border router
140
+
###Update the firmware of the border router
141
141
142
142
This example supports the following border router:
143
143
@@ -147,7 +147,7 @@ The border router supports static and dynamic backhaul configuration. The static
147
147
148
148
Remember to connect the Ethernet cable between the border router and your router. Then power on the board.
149
149
150
-
## Testing
150
+
###Testing
151
151
152
152
By default, the application is built for the LED control demo, in which the device sends a multicast message to all devices in the network when the button is pressed. All devices that receive the multicast message will change the LED status (red LED on/off) to the state defined in the message. Note that the Thread devices can form a network without the existence of the border router. The following applies only to the case when the border router is set up.
153
153
@@ -161,31 +161,31 @@ connected. IP = 2001:db8:a0b:12f0::1
161
161
162
162
You can use this IP address to `ping` from your PC and verify that the connection is working correctly.
163
163
164
-
## Memory optimizations
164
+
###Memory optimizations
165
165
166
166
On some limited platforms, for example NCS36510 or KW24D, building this application might run out of RAM or ROM. In those cases, you can try these instructions to optimize the memory use.
167
167
168
-
### Mbed TLS configuration
168
+
####Mbed TLS configuration
169
169
170
170
You can set the custom Mbed TLS configuration by adding `"macros": ["MBEDTLS_USER_CONFIG_FILE=\"mbedtls_config.h\""]` to the `.json` file. The [example Mbed TLS configuration](https://github.com/ARMmbed/mbed-os-example-mesh-minimal/blob/master/mbedtls_config.h) minimizes the RAM and ROM use of the application. The is not guaranteed to work on every Mbed Enabled platform.
171
171
172
172
This configuration file saves you 8.7 kB of RAM but uses 6.8 kB of more flash.
173
173
174
-
### Disabling the LED control example
174
+
####Disabling the LED control example
175
175
176
176
You can disable the LED control example by specifying `enable-led-control-example": false` in `mbed_app.json`.
177
177
178
178
This saves you about 2.5 kB of flash.
179
179
180
-
### Change network stack's event loop stack size
180
+
####Change network stack's event loop stack size
181
181
182
182
Nanostack's internal event loop is shared with Mbed Client and therefore requires lots of stack to complete the security handshakes using TLS protocols. If you're not using client functionality, you can define the following to use 2 kB of stack:
Nanostack uses internal heap, which you can configure in the `.json`. A thread end device with commissioning enabled requires at least 15 kB to run.
191
191
@@ -197,7 +197,7 @@ In `mbed_app.json`, you find the following line:
197
197
198
198
For 6LoWPAN, you can try 12 kB. For the smallest memory use, configure the node to be in nonrouting mode. See [module-configuration](https://github.com/ARMmbed/mbed-os/tree/master/features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api#module-configuration) for more detail.
199
199
200
-
### Move Nanostack's heap inside the system heap
200
+
####Move Nanostack's heap inside the system heap
201
201
202
202
You can move Nanostack's internal heap within the system heap. This helps on devices with split RAM and on devices in which the compiler fails to fit statically allocated symbols into one section, for example, the NXP KW24D device.
203
203
@@ -209,7 +209,7 @@ Add the following line to `mbed_app.json` to test:
209
209
"mbed-mesh-api.use-malloc-for-heap": true
210
210
```
211
211
212
-
### Use release profile
212
+
####Use release profile
213
213
214
214
For devices with small memory, we recommend using release profiles for building and exporting. Please see the documentation about [build profiles](../tools/build-profiles.html).
215
215
@@ -221,6 +221,6 @@ OR
221
221
$ mbed compile -m KW24D -t IAR --profile release
222
222
```
223
223
224
-
## Troubleshooting
224
+
###Troubleshooting
225
225
226
226
If you have problems, you can review the [documentation](../tutorials/debugging.html) for suggestions on what could be wrong and how to fix it.
Copy file name to clipboardExpand all lines: docs/api/networkinterfaces/CellularInterface.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
<h1id="cellular-api">Cellular API</h1>
1
+
<h2id="cellular-api">Cellular API</h2>
2
2
3
3
<spanclass="images"><span>CellularInterface class hierarchy</span></span>
4
4
@@ -7,7 +7,7 @@
7
7
8
8
The [CellularInterface](../mbed-os-api-doxy/class_cellular_interface.html) class provides a C++ API for connecting to the internet over a Cellular device.
9
9
10
-
## Getting started
10
+
###Getting started
11
11
12
12
1. Choose an [Mbed board that supports cellular](https://os.mbed.com/platforms/?mbed-enabled=15&connectivity=1), such as the [UBLOX-C027](https://os.mbed.com/platforms/u-blox-C027/) or [MTS-DRAGONFLY](https://os.mbed.com/platforms/MTS-Dragonfly/).
13
13
@@ -31,7 +31,7 @@ Received from echo server 4 Bytes
31
31
Success. Exiting
32
32
```
33
33
34
-
## Basic working principles
34
+
###Basic working principles
35
35
36
36
You can use and extend a cellular interface in various different ways. For example,
37
37
@@ -49,25 +49,25 @@ You can use and extend a cellular interface in various different ways. For examp
49
49
- The easy cellular connection uses standard 3GPP AT 27.007 AT commands to set up the cellular modem and to register to the network.
50
50
- 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.
Copy file name to clipboardExpand all lines: docs/api/networkinterfaces/EthInterface.md
+1-3Lines changed: 1 addition & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,7 @@
2
2
3
3
<spanclass="images"><span>EthInterface class hierarchy</span></span>
4
4
5
-
The `EthInterface` provides a C++ API for connecting to the internet over Ethernet.
6
-
By default, this class does not require any configuration. It is able to pick up the default
7
-
Ethernet driver for the target and select correct network stack.
5
+
The `EthInterface` provides a C++ API for connecting to the internet over Ethernet. By default, this class does not require any configuration. It is able to pick up the default Ethernet driver for the target and select correct network stack.
Copy file name to clipboardExpand all lines: docs/api/networkinterfaces/MeshInterface.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
-
<h1id="mesh-api">Mesh</h1>
1
+
<h2id="mesh-api">Mesh</h2>
2
2
3
3
<spanclass="images"><span>MeshInterface class hierarchy</span></span>
4
4
5
-
The Arm Mbed Mesh API allows the application to use the IPv6 mesh network topologies through the [Nanostack](../reference/6LoWPAN-ND-tech.html) networking stack.
5
+
The Arm Mbed Mesh API allows the application to use the IPv6 mesh network topologies through the [Nanostack](../reference/6LoWPAN-ND-tech.html) networking stack.
6
6
7
7
Mbed OS provides three types of IPv6-based mesh networks:
8
8
@@ -14,11 +14,11 @@ The application can use the `LoWPANNDInterface`, `WisunInterface` or `ThreadInte
14
14
15
15
You can configure the mesh interface by providing values in `mbed_app.json`, as the [mesh configuration](../reference/configuration-mesh.html) section documents.
Copy file name to clipboardExpand all lines: docs/api/networkinterfaces/NetworkStatus.md
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,10 @@
1
-
<h1id="network-status">Network status</h1>
1
+
<h2id="network-status">Network status</h2>
2
2
3
3
This interface informs you about connection state changes asynchronously. Providing a method to register a callback function to a socket accomplishes this. Each time the network interface's state changes, it triggers the callback.
The callback needs to handle these possible network states:
10
10
@@ -74,7 +74,7 @@ Optionally, the application might want to set the `connect()` method to nonblock
74
74
75
75
By default, the `connect()` call blocks until `NSAPI_STATUS_GLOBAL_UP` state is reached. Some applications might require only link-local connectivity and therefore do not need to block that long. In those case monitoring the state changes is the preferred behavior.
76
76
77
-
## Using multiple connection status callbacks
77
+
###Using multiple connection status callbacks
78
78
79
79
The NetworkInterface API includes two functions that the applications can use to register more than one status callback for each network interface:
80
80
@@ -109,12 +109,12 @@ You must either refactor the application by replacing `NetworkInterface::attach(
109
109
110
110
This optional and has a small RAM and ROM increase, so applications are not required to use it. Both APIs are still supported, but use is limited to one at a time.
111
111
112
-
## Example
112
+
###Example
113
113
114
114
Registering a status callback that connection state changes trigger depends on whether the network interface provides this functionality.
Copy file name to clipboardExpand all lines: docs/api/networkinterfaces/WifiInterface.md
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
# Wi-Fi
1
+
##Wi-Fi
2
2
3
3
<spanclass="images"><span>WiFiInterface class hierarchy</span></span>
4
4
5
5
The WifiInterface provides a simple C++ API for connecting to the internet over a Wi-Fi device.
|`NSAPI_ERROR_DEVICE_ERROR`| Unknown failure happened in the device. The device may not be capable of reporting more descriptive error codes. |
42
42
43
-
## Security
43
+
###Security
44
44
45
45
For specifying security settings, both `connect()` and `set_credential()` have optional parameter `nsapi_security_t security`, which defines the security mode the device uses. WifiInterface supports the following security modes:
46
46
@@ -54,15 +54,15 @@ For specifying security settings, both `connect()` and `set_credential()` have o
54
54
55
55
Please note that settings should match the security mode from the access point. Also, not all drivers support every mode. For most compatible settings, use `NSAPI_SECURITY_WPA_WPA2`, and set the Wi-Fi access point to allow only WPA2 mode.
56
56
57
-
## Wi-Fi example
57
+
###Wi-Fi example
58
58
59
59
This program scans for Wi-Fi access points in the area. There are multiple [Wi-Fi components](https://os.mbed.com/components/cat/wifi/) that implement the WiFiInterface class. The example below uses the [ESP8266Interface](https://github.com/armmbed/esp8266-driver) and [OdinWiFiInterface](https://github.com/u-blox/ublox-odin-w2-drivers-docs-mbed-5).
60
60
61
61
The ESP8266Interface uses AT commands over serial interface to connect to an external Wi-Fi device. The OdinWiFiInterface provides an Ethernet-like driver to the Mbed OS network stack. The network stack uses the driver to connect to Wi-Fi:
0 commit comments