Skip to content

Commit 64eb60e

Browse files
authored
Merge pull request #14573 from artokin/nanostack_release_13_0_0_for_master
Nanostack release v13.0.0
2 parents b5a6c46 + 2773394 commit 64eb60e

File tree

105 files changed

+3198
-1056
lines changed

Some content is hidden

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

105 files changed

+3198
-1056
lines changed

connectivity/drivers/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAT86RF215.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ static void rf_handle_cca_ed_done(void)
619619
backup_time = 0;
620620
}
621621
rf_backup_timer_start(0, backup_time + PACKET_PROCESSING_TIME);
622-
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL, 0, 0);
622+
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL_RX, 0, 0);
623623
return;
624624
}
625625
if ((cca_enabled == true) && (((int8_t) rf_read_rf_register(RF_EDV, rf_module) > cca_threshold))) {
@@ -997,7 +997,7 @@ static void rf_backup_timer_interrupt(void)
997997
}
998998
if ((rf_state == RF_CSMA_STARTED) || (rf_state == RF_CSMA_WHILE_RX)) {
999999
TEST_CSMA_DONE
1000-
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL, 0, 0);
1000+
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL_RX, 0, 0);
10011001
}
10021002
TEST_TX_DONE
10031003
TEST_RX_DONE

connectivity/drivers/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,11 @@ static void rf_cca_timer_interrupt(void)
848848
rf_flush_tx_fifo();
849849
tx_finnish_time = rf_get_timestamp();
850850
if (device_driver.phy_tx_done_cb) {
851-
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL, 0, 0);
851+
if (rf_state == RF_RX_STARTED) {
852+
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL_RX, 0, 0);
853+
} else {
854+
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL, 0, 0);
855+
}
852856
}
853857
} else {
854858
if (status == PHY_RESTART_CSMA) {
@@ -1143,7 +1147,7 @@ static void rf_irq_task_process_irq(void)
11431147
tx_finnish_time = rf_get_timestamp();
11441148
rf_update_tx_active_time();
11451149
TEST_TX_DONE
1146-
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL, 1, 0);
1150+
device_driver.phy_tx_done_cb(rf_radio_driver_id, mac_tx_handle, PHY_LINK_CCA_FAIL_RX, 1, 0);
11471151
rf_send_command(S2LP_CMD_SABORT);
11481152
rf_poll_state_change(S2LP_STATE_READY);
11491153
rf_send_command(S2LP_CMD_FLUSHTXFIFO);

connectivity/libraries/nanostack-libservice/mbed-client-libservice/ns_nvm_helper.h

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
// ----------------------------------------------------------------------------
2-
// Copyright 2016-2017 ARM Ltd.
3-
//
4-
// SPDX-License-Identifier: Apache-2.0
5-
//
6-
// Licensed under the Apache License, Version 2.0 (the "License");
7-
// you may not use this file except in compliance with the License.
8-
// You may obtain a copy of the License at
9-
//
10-
// http://www.apache.org/licenses/LICENSE-2.0
11-
//
12-
// Unless required by applicable law or agreed to in writing, software
13-
// distributed under the License is distributed on an "AS IS" BASIS,
14-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
// See the License for the specific language governing permissions and
16-
// limitations under the License.
17-
// ----------------------------------------------------------------------------
1+
/*
2+
* Copyright (c) 2016-2017 ARM Limited. All rights reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
* Licensed under the Apache License, Version 2.0 (the License); you may
5+
* not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1816

1917
/**
2018
* NanoStack NVM helper functions to read, write and delete key-value pairs to platform NVM.

connectivity/libraries/nanostack-libservice/source/nvmHelper/ns_nvm_helper.c

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
// ----------------------------------------------------------------------------
2-
// Copyright 2016-2017 ARM Ltd.
3-
//
4-
// SPDX-License-Identifier: Apache-2.0
5-
//
6-
// Licensed under the Apache License, Version 2.0 (the "License");
7-
// you may not use this file except in compliance with the License.
8-
// You may obtain a copy of the License at
9-
//
10-
// http://www.apache.org/licenses/LICENSE-2.0
11-
//
12-
// Unless required by applicable law or agreed to in writing, software
13-
// distributed under the License is distributed on an "AS IS" BASIS,
14-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15-
// See the License for the specific language governing permissions and
16-
// limitations under the License.
17-
// ----------------------------------------------------------------------------
1+
/*
2+
* Copyright (c) 2016-2017 ARM Limited. All rights reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
* Licensed under the Apache License, Version 2.0 (the License); you may
5+
* not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an AS IS BASIS, WITHOUT
12+
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
1816

1917
#include <string.h>
2018
#include <ns_types.h>

connectivity/nanostack/sal-stack-nanostack/nanostack/dhcp_service_api.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,15 @@ uint16_t dhcp_service_init(int8_t interface_id, dhcp_instance_type_e instance_ty
142142
*/
143143
void dhcp_service_relay_instance_enable(uint16_t instance, uint8_t *server_address);
144144

145+
/**
146+
* \brief Enable DHCPv6 Relay Agent to add interface ID option to relay frame. Default is disabled.
147+
*
148+
*
149+
* \param instance The instance ID of the registered server.
150+
* \param enable true add interface option
151+
*/
152+
void dhcp_service_relay_interface_id_option_enable(uint16_t instance, bool enable);
153+
145154
/**
146155
* \brief Get DHCPv6 Relay Agent address pointer.
147156
*

connectivity/nanostack/sal-stack-nanostack/nanostack/fhss_api.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ typedef struct fhss_callback fhss_callback_t;
4949
typedef enum {
5050
FHSS_UNSYNCHRONIZED,
5151
FHSS_SYNCHRONIZED,
52+
FHSS_EXPEDITED_FORWARDING
5253
} fhss_states;
5354

5455
/**

connectivity/nanostack/sal-stack-nanostack/nanostack/fhss_ws_extension.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,27 @@ extern int ns_fhss_set_neighbor_info_fp(const fhss_api_t *fhss_api, fhss_get_nei
118118
*/
119119
extern int ns_fhss_ws_set_hop_count(const fhss_api_t *fhss_api, const uint8_t hop_count);
120120

121+
/**
122+
* @brief WS TX allowance levels.
123+
*/
124+
typedef enum {
125+
/** Allow transmitting only on TX slots. */
126+
WS_TX_SLOT,
127+
/** Allow transmitting only on TX and RX slots. */
128+
WS_TX_AND_RX_SLOT,
129+
/** Allow transmitting always. Also unicast on broadcast channel. */
130+
WS_TX_ALWAYS
131+
} fhss_ws_tx_allow_level;
132+
133+
/**
134+
* @brief Set node unicast TX allowance level. Allows device to use the unicast and broadcast channel for unicast transmission as described by fhss_ws_tx_allow_level.
135+
* @param fhss_api FHSS instance.
136+
* @param global_level Level of TX allowance in normal mode.
137+
* @param ef_level Level of TX allowance in expedited forwarding mode.
138+
* @return 0 on success, -1 on fail.
139+
*/
140+
extern int ns_fhss_ws_set_tx_allowance_level(const fhss_api_t *fhss_api, const fhss_ws_tx_allow_level global_level, const fhss_ws_tx_allow_level ef_level);
141+
121142
#ifdef __cplusplus
122143
}
123144
#endif

connectivity/nanostack/sal-stack-nanostack/nanostack/mac_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,10 +128,11 @@ typedef void mcps_data_request(const mac_api_t *api, const mcps_data_req_t *data
128128
* @param data MCPS-DATA.request specific values
129129
* @param ie_ext Information element list to MCPS-DATA.request
130130
* @param asynch_channel_list Optional channel list to asynch data request. Give NULL when normal data request.
131+
* @param priority Data request priority level
131132
*
132133
* Asynch data request is mac standard extension. asynch_channel_list include channel mask which channel message is requested to send.
133134
*/
134-
typedef void mcps_data_request_ext(const mac_api_t *api, const mcps_data_req_t *data, const mcps_data_req_ie_list_t *ie_ext, const struct channel_list_s *asynch_channel_list);
135+
typedef void mcps_data_request_ext(const mac_api_t *api, const mcps_data_req_t *data, const mcps_data_req_ie_list_t *ie_ext, const struct channel_list_s *asynch_channel_list, mac_data_priority_t priority);
135136

136137
/**
137138
* @brief mcps_purge_request MCPS_PURGE request call

connectivity/nanostack/sal-stack-nanostack/nanostack/mac_mcps.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,5 +192,17 @@ typedef struct mcps_edfe_response_s {
192192
bool use_message_handle_to_discover: 1; /**< EDFE Data request message ID is valid at message_handle. */
193193
} mcps_edfe_response_t;
194194

195+
/**
196+
* @brief enum mac_data_priority_t Data request priority level
197+
*
198+
* Data request priority level may affect CCA process and MAC queue process
199+
*/
200+
typedef enum mac_data_priority_e {
201+
MAC_DATA_NORMAL_PRIORITY = 0, /**< Normal MCPS DATA REQ */
202+
MAC_DATA_MEDIUM_PRIORITY = 1, /**< Indirect Data which is polled */
203+
MAC_DATA_HIGH_PRIORITY = 2, /**< MAC command usually use this and beacon */
204+
MAC_DATA_EXPEDITE_FORWARD = 3 /**< Expedite forward level give highest priority */
205+
} mac_data_priority_t;
206+
195207

196208
#endif // MAC_MCPS_H

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ 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+
macRequestRestart = 0xf1, /*< Configure failed packet data request restart */
267268
macEdfeForceStop = 0xf2, /*< Use this command for Data wait timeout at LLC: Mac stop Edfe session data wait and enable normal FHSS mode */
268269
macSetDataWhitening = 0xf3, /*< Enable or disable data whitening, boolean true for enable, false for disable */
269270
macCCAThresholdStart = 0xf4, /*< Start automatic CCA threshold */
@@ -517,4 +518,16 @@ typedef struct mlme_multi_csma_ca_s {
517518
uint16_t multi_cca_interval; /**< Length of the additional CSMA-CA period(s) in microseconds */
518519
} mlme_multi_csma_ca_param_t;
519520

521+
/**
522+
* @brief struct mlme_request_restart_config_s Set failed packet request restart configuration
523+
*
524+
* Non standard extension to restart data request after failed CCA or TX attempts
525+
*/
526+
typedef struct mlme_request_restart_config_s {
527+
uint8_t cca_failure_restart_max; /**< Max number of restarts after CCA failure */
528+
uint8_t tx_failure_restart_max; /**< Max number of restarts after TX failure */
529+
uint16_t blacklist_min_ms; /**< Blacklist min, which is doubled by every restart */
530+
uint16_t blacklist_max_ms; /**< Blacklist max, largest allowed blacklist time */
531+
} mlme_request_restart_config_t;
532+
520533
#endif /* MLME_H_ */

0 commit comments

Comments
 (0)