Merge branch 'bugfix/filter_repeated_packages' into 'master'

filter repeated packages but not send response

See merge request espressif/esp-idf!15906
This commit is contained in:
Island 2022-01-24 07:51:02 +00:00
commit e50f250b16
5 changed files with 57 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
@ -109,9 +109,10 @@ int ble_mesh_node_statistics_accumulate(uint8_t *data, uint32_t value, uint16_t
xSemaphoreTake(ble_mesh_node_sema, portMAX_DELAY);
for (i = 0; i < ble_mesh_node_statistics.total_package_num; i++) {
/* Filter out repeated packages during retransmission */
if (ble_mesh_node_statistics.package_index[i] == sequence_num) {
xSemaphoreGive(ble_mesh_node_sema);
return 1;
return 0;
}
}
@ -122,6 +123,7 @@ int ble_mesh_node_statistics_accumulate(uint8_t *data, uint32_t value, uint16_t
}
for (i = 0; i < ble_mesh_node_statistics.total_package_num; i++) {
/* Judge whether the package is received for the first time */
if (ble_mesh_node_statistics.package_index[i] == 0) {
ble_mesh_node_statistics.package_index[i] = sequence_num;
ble_mesh_node_statistics.package_num += 1;

View File

@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

View File

@ -21,6 +21,8 @@ CONFIG_BLE_MESH_GENERIC_ONOFF_CLI=y
CONFIG_BLE_MESH_PROVISIONER=y
CONFIG_BLE_MESH_SELF_TEST=y
CONFIG_BLE_MESH_TEST_AUTO_ENTER_NETWORK=y
CONFIG_BLE_MESH_WAIT_FOR_PROV_MAX_DEV_NUM=80
CONFIG_BLE_MESH_MAX_PROV_NODES=80
# partitions
CONFIG_PARTITION_TABLE_CUSTOM=y

View File

@ -0,0 +1,25 @@
# ESP32C3-specific
##Override some defaults so BT stack is enabled
# by default in this example
CONFIG_BT_ENABLED=y
CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE=y
CONFIG_BT_CTRL_BLE_MESH_SCAN_DUPL_EN=y
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
CONFIG_BT_BTU_TASK_STACK_SIZE=4512
CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y
# Override some defaults of ESP BLE Mesh
CONFIG_BLE_MESH=y
CONFIG_BLE_MESH_NODE=y
CONFIG_BLE_MESH_PB_GATT=y
CONFIG_BLE_MESH_TX_SEG_MSG_COUNT=3
CONFIG_BLE_MESH_RX_SEG_MSG_COUNT=3
CONFIG_BLE_MESH_CFG_CLI=y
CONFIG_BLE_MESH_GENERIC_ONOFF_CLI=y
CONFIG_BLE_MESH_PROVISIONER=y
CONFIG_BLE_MESH_SELF_TEST=y
CONFIG_BLE_MESH_TEST_AUTO_ENTER_NETWORK=y
CONFIG_BLE_MESH_WAIT_FOR_PROV_MAX_DEV_NUM=80
CONFIG_BLE_MESH_MAX_PROV_NODES=80
# end of ESP32C3-specific

View File

@ -0,0 +1,25 @@
# ESP32S3-specific
# Override some defaults so BT stack is enabled
# by default in this example
CONFIG_BT_ENABLED=y
CONFIG_BT_CTRL_SCAN_DUPL_TYPE_DATA_DEVICE=y
CONFIG_BT_CTRL_BLE_MESH_SCAN_DUPL_EN=y
CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MANUAL=y
CONFIG_BT_BTU_TASK_STACK_SIZE=4512
CONFIG_BT_BLE_42_FEATURES_SUPPORTED=y
# Override some defaults of ESP BLE Mesh
CONFIG_BLE_MESH=y
CONFIG_BLE_MESH_NODE=y
CONFIG_BLE_MESH_PB_GATT=y
CONFIG_BLE_MESH_TX_SEG_MSG_COUNT=3
CONFIG_BLE_MESH_RX_SEG_MSG_COUNT=3
CONFIG_BLE_MESH_CFG_CLI=y
CONFIG_BLE_MESH_GENERIC_ONOFF_CLI=y
CONFIG_BLE_MESH_PROVISIONER=y
CONFIG_BLE_MESH_SELF_TEST=y
CONFIG_BLE_MESH_TEST_AUTO_ENTER_NETWORK=y
CONFIG_BLE_MESH_WAIT_FOR_PROV_MAX_DEV_NUM=80
CONFIG_BLE_MESH_MAX_PROV_NODES=80
# end of ESP32S3-specific