From 0e21cdd18a87f80f32e3272b1b2fdee69de84087 Mon Sep 17 00:00:00 2001 From: luoxu Date: Tue, 2 Apr 2024 11:02:44 +0800 Subject: [PATCH] fix(ble_mesh): fix error condition for heartbeat filter adding node address --- .../esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c b/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c index 16b0805dea..4f6b46196a 100644 --- a/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c +++ b/components/bt/esp_ble_mesh/api/core/esp_ble_mesh_networking_api.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -576,9 +576,9 @@ esp_err_t esp_ble_mesh_provisioner_set_heartbeat_filter_info(uint8_t op, esp_ble return ESP_ERR_INVALID_ARG; } - if (!ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_src) && - !ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_dst) && - !ESP_BLE_MESH_ADDR_IS_GROUP(info->hb_dst)) { + if (!(ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_src) && + (ESP_BLE_MESH_ADDR_IS_UNICAST(info->hb_dst) || + ESP_BLE_MESH_ADDR_IS_GROUP(info->hb_dst)))) { return ESP_ERR_INVALID_ARG; }