Skip to content

Commit 364a81b

Browse files
author
Arto Kinnunen
committed
Merge commit 'e3c2a36da0985647730e26c63b50d480cce9ef79' into mbed-os-5.15
* commit 'e3c2a36da0985647730e26c63b50d480cce9ef79': Squashed 'features/nanostack/sal-stack-nanostack/' changes from cc03296..b3fe574
2 parents 2c16a69 + e3c2a36 commit 364a81b

File tree

101 files changed

+5611
-1378
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+5611
-1378
lines changed

features/nanostack/sal-stack-nanostack/README.md

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,29 @@ ARM Mesh networking stack
33

44
This repository contains the ARM mesh networking stack that provides support for the following mesh protocols:
55

6-
* 6LoWPAN with Neighbor Discovery (ND) and Mesh Link Establishment (MLE)
7-
* Thread
8-
* Wi-SUN
6+
* 6LoWPAN with Neighbor Discovery (ND) and Mesh Link Establishment (MLE)
7+
* Wi-SUN
98

10-
All networking stacks are using IEEE 802.15.4 based radios.
9+
All networking stacks are using IEEE 802.15.4 based radios.
1110

1211
The full documentation is hosted in [Mbed OS documentation](https://os.mbed.com/docs/mbed-os/latest/reference/mesh-tech.html).
1312

14-
On mbed OS, mesh networking stacks can be used through [Mbed Mesh API](https://os.mbed.com/docs/mbed-os/latest/apis/mesh-api.html) and [Network Socket API](https://os.mbed.com/docs/mbed-os/v5.11/apis/network-socket.html).
13+
On mbed OS, mesh networking stacks can be used through [Mbed Mesh API](https://os.mbed.com/docs/mbed-os/latest/apis/mesh-api.html) and [Network Socket API](https://os.mbed.com/docs/mbed-os/latest/apis/network-socket.html).
1514

1615
To see, how the mesh networking stack works, check the example application [mbed-os-example-mesh-minimal](https://github.com/ARMmbed/mbed-os-example-mesh-minimal).
1716

18-
19-
##6LoWPAN with ND and MLE
17+
18+
## 6LoWPAN with ND and MLE
2019

2120
This networking stack is using standard 6LoWPAN and uses:
2221

2322
* Neighbor Discovery Protocol ([RFC4861](https://tools.ietf.org/html/rfc4861)) to locate other devices in the mesh network.
2423
* Mesh-Link-Establishment ([draft-kelsey-intarea-mesh-link-establishment-06](https://tools.ietf.org/html/draft-kelsey-intarea-mesh-link-establishment-06)) is used for establishing and configuring secure radio links.
25-
26-
##Thread
27-
Thread is standardized by [Thread group](https://www.threadgroup.org/).
28-
29-
![](docs/img/thread_certified.png)
3024

31-
mbed OS is now a Thread Certified Component. Using IPv6 with 6LoWPAN as the foundation, Thread technology provides a low-power, self-healing mesh network designed for the home.
3225

33-
##Wi-SUN
26+
## Wi-SUN
3427
Wi-SUN (Smart Utility Networks) specification is standardized by [Wi-SUN Alliance](https://www.wi-sun.org/).
3528

36-
Mbed OS release 5.12 contains the initial Mbed Wi-SUN FAN implementation. Functionality of the Mbed Wi-SUN network stack will be updated when the Wi-SUN protocol is specified further.
3729

3830
## License
3931

Binary file not shown.

features/nanostack/sal-stack-nanostack/mbed_lib.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@
99
},
1010
"macros": ["NS_USE_EXTERNAL_MBED_TLS"],
1111
"target_overrides": {
12-
"KW24D": {
13-
"nanostack.configuration": "lowpan_router"
14-
},
15-
"NCS36510": {
16-
"nanostack.configuration": "lowpan_router"
17-
},
1812
"TB_SENSE_12": {
1913
"nanostack.configuration": "lowpan_router"
2014
},

features/nanostack/sal-stack-nanostack/nanostack/fhss_config.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,16 @@ typedef struct fhss_configuration {
8888
*/
8989
typedef int32_t fhss_vendor_defined_cf(const fhss_api_t *api, uint16_t slot, uint8_t eui64[8], uint16_t bsi, uint16_t number_of_channels);
9090

91+
/**
92+
* \brief Struct fhss_config_parameters defines FHSS configuration parameters.
93+
*
94+
*/
95+
typedef struct fhss_config_parameters {
96+
/** Number of channel retries defines how many consecutive channels are used when retransmitting a frame after initial transmission channel. */
97+
uint8_t number_of_channel_retries;
98+
} fhss_config_parameters_t;
99+
100+
91101
/**
92102
* \brief Struct fhss_ws_configuration defines configuration of WS FHSS.
93103
*/
@@ -125,6 +135,9 @@ typedef struct fhss_ws_configuration {
125135
/** Vendor defined channel function. */
126136
fhss_vendor_defined_cf *vendor_defined_cf;
127137

138+
/** Configuration parameters. */
139+
fhss_config_parameters_t config_parameters;
140+
128141
} fhss_ws_configuration_t;
129142

130143
/**

features/nanostack/sal-stack-nanostack/nanostack/fhss_test_api.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,17 @@ extern "C" {
3939
*/
4040
int8_t fhss_set_optimal_packet_length(const fhss_api_t *fhss_api, uint16_t packet_length);
4141

42+
/**
43+
* \brief Set number of channel retries
44+
*
45+
* \param fhss_api FHSS instance.
46+
* \param number_of_channel_retries Number of channel retries
47+
*
48+
* \return 0 Success
49+
* \return -1 Failure
50+
*/
51+
int8_t fhss_set_number_of_channel_retries(const fhss_api_t *fhss_api, uint8_t number_of_channel_retries);
52+
4253
#ifdef __cplusplus
4354
}
4455
#endif

features/nanostack/sal-stack-nanostack/nanostack/mlme.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,8 @@ typedef enum {
264264
macAutoRequestKeyIndex = 0x7b, /*<The index of the key used for automatic data*/
265265
macDefaultKeySource = 0x7c, /*<Default key source*/
266266
//NON standard extension
267+
macCCAThresholdStart = 0xf4, /*< Start automatic CCA threshold */
268+
macDevicePendingAckTrig = 0xf5, /*< Trig Pending ACK for Accepted Data packet for temporary neighbour */
267269
mac802_15_4Mode = 0xf6, /*<IEEE 802.15.4 mode*/
268270
macDeviceDescriptionPanIDUpdate = 0xf7, /*<Thread pending link update case this will update device descrioton list pan-id to new one*/
269271
macTXPower = 0xf8, /*<TX output power*/

features/nanostack/sal-stack-nanostack/nanostack/ns_file_system.h

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,109 @@ int ns_file_system_set_root_path(const char *root_path);
5050
*/
5151
char *ns_file_system_get_root_path(void);
5252

53+
/**
54+
* \brief NS file handle
55+
*
56+
*/
57+
typedef void *NS_FILE;
58+
59+
/**
60+
* File open callback
61+
*
62+
* Depending on underlying file system file open for read for non-existing
63+
* files can return success. In that case file read will fail.
64+
*
65+
* \param filename filename
66+
* \param mode can be either "r" or "w"
67+
*
68+
* \return file handle
69+
* \return NULL on error
70+
*
71+
*/
72+
typedef NS_FILE(*ns_file_open)(const char *filename, const char *mode);
73+
74+
/**
75+
* File close callback
76+
*
77+
* \param handle file handle
78+
*
79+
* \return 0 on success
80+
* \return < 0 in case of errors
81+
*
82+
*/
83+
typedef int (*ns_file_close)(NS_FILE *handle);
84+
85+
/**
86+
* File remove callback
87+
*
88+
* \param filename filename
89+
*
90+
* \return 0 on success
91+
* \return < 0 in case of errors
92+
*
93+
*/
94+
typedef int (*ns_file_remove)(const char *filename);
95+
96+
/**
97+
* File write callback
98+
*
99+
* Write is not stream write. The whole file is written from start to end
100+
* and if function is called again, previous file content is replaced with
101+
* new content.
102+
*
103+
* \param handle file handle
104+
* \param buffer buffer
105+
* \param buffer buffer size
106+
*
107+
* \return bytes written
108+
*
109+
*/
110+
typedef size_t (*ns_file_write)(NS_FILE *handle, const void *buffer, size_t size);
111+
112+
/**
113+
* File read callback
114+
*
115+
* Read is not stream read. The whole file is read from start to end
116+
* and if function is called again, read is started from start again.
117+
*
118+
* \param handle file handle
119+
* \param buffer buffer
120+
* \param size buffer size
121+
*
122+
* \return bytes written
123+
*
124+
*/
125+
typedef size_t (*ns_file_read)(NS_FILE *handle, void *buffer, size_t size);
126+
127+
/**
128+
* File size callback
129+
*
130+
* Reads file size.
131+
*
132+
* \param handle file handle
133+
* \param size file size
134+
*
135+
* \return 0 on success
136+
* \return < 0 in case of reading file size is not supported
137+
*
138+
*/
139+
typedef int (*ns_file_size)(NS_FILE *handle, size_t *size);
140+
141+
/**
142+
* File callbacks set
143+
*
144+
* Sets file handling callbacks to nanostack.
145+
*
146+
* \param open file open callback
147+
* \param close file close callback
148+
* \param remove file remove callback
149+
* \param write file write callback
150+
* \param read file read callback
151+
* \param size file size callback
152+
*
153+
*/
154+
void ns_file_system_callbacks_set(ns_file_open open, ns_file_close close, ns_file_remove remove, ns_file_write write, ns_file_read read, ns_file_size size);
155+
53156
#ifdef __cplusplus
54157
}
55158
#endif
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright (c) 2020, Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
/**
19+
* \file ns_time_api.h
20+
* \brief Nanostack time API
21+
*
22+
* This is Nanostack time API.
23+
*
24+
*/
25+
26+
#ifndef NS_TIME_API_H_
27+
#define NS_TIME_API_H_
28+
29+
#include "ns_types.h"
30+
31+
/**
32+
* System time callback.
33+
*
34+
* Callback shall return the system time in seconds after 1970.
35+
*
36+
* \param seconds system time in seconds
37+
*
38+
*/
39+
typedef uint64_t ns_time_api_system_time_callback(void);
40+
41+
/**
42+
* System time callback set.
43+
*
44+
* Sets callback for the system time.
45+
*
46+
* \param callback system time callback
47+
*
48+
*/
49+
void ns_time_api_system_time_callback_set(ns_time_api_system_time_callback callback);
50+
51+
#endif /* NS_TIME_API_H_ */

features/nanostack/sal-stack-nanostack/nanostack/platform/arm_hal_phy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ typedef enum {
8080
PHY_EXTENSION_FILTERING_SUPPORT, /**< Return filtering modes that can be supported by the PHY driver. See phy_link_filters_e */
8181
PHY_EXTENSION_SET_TX_POWER, /**< Set TX output power which is given as percentage of maximum. 0 is the lowest possible TX power and 100 is the highest possible TX power */
8282
PHY_EXTENSION_SET_CCA_THRESHOLD, /**< Set CCA threshold which is given as percentage of maximum threshold. 0 is the lowest(strictest) possible threshold and 100 is the highest possible threshold */
83+
PHY_EXTENSION_SET_CHANNEL_CCA_THRESHOLD, /**< Set CCA threshold which is given as dBm. This value is set in PHY_LINK_CCA_PREPARE callback and PHY driver should update the CCA threshold configuration */
8384
PHY_EXTENSION_SET_802_15_4_MODE /**< Set IEEE 802.15.4 mode as defined by phy_802_15_4_mode_t*/
8485
} phy_extension_type_e;
8586

0 commit comments

Comments
 (0)