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: features/nanostack/FEATURE_NANOSTACK/mbed-mesh-api/README.md
+38-7Lines changed: 38 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@ ARM mbed mesh API allows the client to use the IPv6 mesh network.
4
4
5
5
The client can use the `LoWPANNDInterface` or `ThreadInterface` object for connecting to the mesh network and when successfully connected, the client can create a socket by using the [mbed C++ socket API](https://developer.mbed.org/teams/NetworkSocketAPI/code/NetworkSocketAPI/docs/tip/) to start communication with a remote peer.
6
6
7
+
For ethernet `NanostackEthernetInterface` is provided.
8
+
7
9
## Supported mesh networking modes
8
10
9
11
Currently, 6LoWPAN-ND (neighbour discovery) and Thread bootstrap modes are supported.
@@ -27,18 +29,18 @@ An example of the configuration file:
27
29
}
28
30
```
29
31
30
-
**Configurable parameters in section `mbed-mesh-api`:**
32
+
### Configurable parameters in section mbed-mesh-api
31
33
32
34
| Parameter name | Value | Description |
33
35
| --------------- | ------------- | ----------- |
34
36
| heap-size | number [0-0xfffe]| Nanostack's internal heap size |
|hread-device-type | enum from mesh_device_type_t | Set device operating mode. |
43
+
|thread-device-type | enum from mesh_device_type_t | Set device operating mode. |
42
44
| thread-config-channel-mask | number [0-0x07fff800]| Channel mask, 0x07fff800 scans all channels. |
43
45
| thread-config-channel-page | number [0, 2]| Channel page, 0 for 2,4 GHz and 2 for sub-GHz radios. |
44
46
| thread-config-channel | number [0-27]| RF channel to use. |
@@ -47,7 +49,7 @@ An example of the configuration file:
47
49
| thread-config-ml-prefix | byte array [8]| Mesh local prefix. |
48
50
| thread-config-pskc | byte array [16]| Pre-Shared Key for the Commissioner. |
49
51
50
-
**6LoWPAN related configuration parameters:**
52
+
### 6LoWPAN related configuration parameters
51
53
52
54
| Parameter name | Type | Description |
53
55
| --------------- | ---------| ----------- |
@@ -63,7 +65,9 @@ An example of the configuration file:
63
65
64
66
## Usage notes
65
67
66
-
This module should not be used directly by the applications. The applications should use the `LoWPANNDInterface` or `ThreadInterface` directly.
68
+
This module should not be used directly by the applications. The applications should use the `LoWPANNDInterface`, `ThreadInterface` or `NanostackEthernetInterface` directly.
69
+
70
+
When using Ethernet interface, there is no configuration options available. It is using dynamic mode to learn the IPv6 prefix from the network. No static configuration is supported.
67
71
68
72
### Network connection states
69
73
@@ -77,13 +81,20 @@ See the example application [mbed-os-example-mesh-minimal](https://github.com/AR
77
81
78
82
## Usage example for 6LoWPAN ND mode
79
83
80
-
**Create a network interface:**
84
+
Create a network interface and driver objects.
81
85
82
86
```
83
87
LoWPANNDInterface mesh;
88
+
NanostackRfPhyNcs36510 rf_phy;
84
89
```
85
90
86
-
**Connect:**
91
+
Initialize interface with given PHY driver.
92
+
93
+
```
94
+
mesh.initialize(&rf_phy);
95
+
```
96
+
97
+
Then connect to network:
87
98
88
99
```
89
100
if (mesh.connect()) {
@@ -102,3 +113,23 @@ Basically the same as for ND, but the network interface uses different class:
102
113
ThreadInterface mesh;
103
114
mesh.connect();
104
115
```
116
+
117
+
## Usage example with Ethernet
118
+
119
+
API is still the same, you just need to provide a driver that implements `NanostackEthernetPhy` API.
120
+
121
+
```
122
+
NanostackEthernetInterface eth;
123
+
NanostackEthernetPhyK64F phy;
124
+
125
+
int main() {
126
+
eth.initialize(&phy);
127
+
128
+
if (eth.connect()) {
129
+
printf("Connection failed!\r\n");
130
+
return -1;
131
+
}
132
+
133
+
printf("connected. IP = %s\r\n", eth.get_ip_address());
0 commit comments