mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'feature/add_duplicate_excep_list_vsc_v5.0' into 'release/v5.0'
feat(mesh): Add support for Duplicate Exception list update VSC for Nimble (v5.0) See merge request espressif/esp-idf!25133
This commit is contained in:
commit
60acb3239d
@ -8,7 +8,6 @@ if BLE_MESH
|
||||
|
||||
config BLE_MESH_USE_DUPLICATE_SCAN
|
||||
bool "Support Duplicate Scan in BLE Mesh"
|
||||
depends on BT_BLUEDROID_ENABLED
|
||||
select BTDM_BLE_SCAN_DUPL if IDF_TARGET_ESP32
|
||||
select BTDM_BLE_MESH_SCAN_DUPL_EN if IDF_TARGET_ESP32
|
||||
select BT_CTRL_BLE_SCAN_DUPL if IDF_TARGET_ESP32C3
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2017 Nordic Semiconductor ASA
|
||||
* SPDX-FileCopyrightText: 2015-2016 Intel Corporation
|
||||
* SPDX-FileContributor: 2018-2021 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileContributor: 2018-2023 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@ -1943,9 +1943,43 @@ int bt_mesh_encrypt_be(const uint8_t key[16], const uint8_t plaintext[16],
|
||||
}
|
||||
|
||||
#if defined(CONFIG_BLE_MESH_USE_DUPLICATE_SCAN)
|
||||
int bt_mesh_update_exceptional_list(uint8_t sub_code, uint8_t type, void *info)
|
||||
int bt_mesh_update_exceptional_list(uint8_t sub_code, uint32_t type, void *info)
|
||||
{
|
||||
BT_ERR("Unsupported for NimBLE host");
|
||||
return 0;
|
||||
uint8_t value[6] = {0};
|
||||
int rc = 0;
|
||||
|
||||
#if MYNEWT_VAL(BLE_HCI_VS)
|
||||
struct ble_hci_vs_duplicate_exception_list_cp cmd;
|
||||
#endif
|
||||
|
||||
if ((sub_code > BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN) ||
|
||||
(sub_code < BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
|
||||
type > BLE_MESH_EXCEP_LIST_TYPE_MESH_PROXY_ADV) ||
|
||||
(sub_code == BLE_MESH_EXCEP_LIST_SUB_CODE_CLEAN &&
|
||||
!(type & BLE_MESH_EXCEP_LIST_CLEAN_ALL_LIST))) {
|
||||
BT_ERR("%s, Invalid parameter", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (type == BLE_MESH_EXCEP_LIST_TYPE_MESH_LINK_ID) {
|
||||
if (!info) {
|
||||
BT_ERR("Invalid Provisioning Link ID");
|
||||
return -EINVAL;
|
||||
}
|
||||
sys_memcpy_swap(value, info, sizeof(uint32_t));
|
||||
}
|
||||
|
||||
BT_DBG("%s exceptional list, type 0x%08x", sub_code ? "Remove" : "Add", type);
|
||||
|
||||
#if MYNEWT_VAL(BLE_HCI_VS)
|
||||
cmd.operation = sub_code;
|
||||
cmd.type = htole32(type);
|
||||
memcpy(&cmd.device_info, value, 6);
|
||||
|
||||
rc = ble_hs_hci_send_vs_cmd(BLE_HCI_OCF_VS_DUPLICATE_EXCEPTION_LIST,
|
||||
&cmd, sizeof(cmd), NULL, 0);
|
||||
#endif
|
||||
|
||||
return rc;
|
||||
}
|
||||
#endif
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit b1f1a81af3b4a5b56227785dc4418956de927737
|
||||
Subproject commit b90a4c90d7125f03ef9f00b15951d7edccbab1f6
|
@ -1134,6 +1134,14 @@ struct ble_hci_vs_rd_static_addr_rp {
|
||||
uint8_t addr[6];
|
||||
} __attribute__((packed));
|
||||
|
||||
#define BLE_HCI_OCF_VS_DUPLICATE_EXCEPTION_LIST (MYNEWT_VAL(BLE_HCI_VS_OCF_OFFSET) + (0x0108))
|
||||
struct ble_hci_vs_duplicate_exception_list_cp {
|
||||
uint8_t operation;
|
||||
uint32_t type;
|
||||
uint8_t device_info[6];
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
/* Command Specific Definitions */
|
||||
/* --- Set controller to host flow control (OGF 0x03, OCF 0x0031) --- */
|
||||
#define BLE_HCI_CTLR_TO_HOST_FC_OFF (0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user