From 50d17a0d52410290da788a7de9a027fd28478896 Mon Sep 17 00:00:00 2001 From: Aleksandr Khromykh Date: Mon, 6 Nov 2023 12:51:48 +0100 Subject: [PATCH] Bluetooth: Mesh: split gatt client and solicitation pdu sending The ability to send the solicitation PDU doesn't depend on GATT Client role. Commit makes independent one functionality from another. Signed-off-by: Aleksandr Khromykh --- doc/connectivity/bluetooth/api/mesh/proxy.rst | 2 +- include/zephyr/bluetooth/mesh/proxy.h | 4 ++-- subsys/bluetooth/mesh/Kconfig | 5 ++--- subsys/bluetooth/mesh/shell/shell.c | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/doc/connectivity/bluetooth/api/mesh/proxy.rst b/doc/connectivity/bluetooth/api/mesh/proxy.rst index d9212e24bc0..823401c9571 100644 --- a/doc/connectivity/bluetooth/api/mesh/proxy.rst +++ b/doc/connectivity/bluetooth/api/mesh/proxy.rst @@ -31,7 +31,7 @@ In the case where both GATT Proxy and Private GATT Proxy states are disabled on device cannot connect to it. A node supporting the :ref:`bluetooth_mesh_od_srv` may however be solicited to advertise connectable advertising events without enabling the Private GATT Proxy state. To solicit the node, the legacy device can send a Solicitation PDU by calling the -:func:`bt_mesh_proxy_solicit` function. To enable this feature, the client must to be compiled with +:func:`bt_mesh_proxy_solicit` function. To enable this feature, the device must to be compiled with the :kconfig:option:`CONFIG_BT_MESH_PROXY_SOLICITATION` option set. Solicitation PDUs are non-mesh, non-connectable, undirected advertising messages containing Proxy diff --git a/include/zephyr/bluetooth/mesh/proxy.h b/include/zephyr/bluetooth/mesh/proxy.h index 60a397b9484..03576acf9bf 100644 --- a/include/zephyr/bluetooth/mesh/proxy.h +++ b/include/zephyr/bluetooth/mesh/proxy.h @@ -97,9 +97,9 @@ int bt_mesh_proxy_connect(uint16_t net_idx); */ int bt_mesh_proxy_disconnect(uint16_t net_idx); -/** @brief Schedule advertising of Solicitation PDUs on Proxy Client . +/** @brief Schedule advertising of Solicitation PDUs. * - * Once called Proxy Client will schedule advertising Solicitation PDUs for the amount of time + * Once called, the device will schedule advertising Solicitation PDUs for the amount of time * defined by @c adv_int * (@c CONFIG_BT_MESH_SOL_ADV_XMIT + 1), where @c adv_int is 20ms * for Bluetooth v5.0 or higher, or 100ms otherwise. * diff --git a/subsys/bluetooth/mesh/Kconfig b/subsys/bluetooth/mesh/Kconfig index a7155d8e514..de409e9c53c 100644 --- a/subsys/bluetooth/mesh/Kconfig +++ b/subsys/bluetooth/mesh/Kconfig @@ -1439,11 +1439,10 @@ config BT_MESH_SOLICITATION bool config BT_MESH_PROXY_SOLICITATION - bool "Proxy solicitation feature for Proxy Client support" - depends on BT_MESH_PROXY_CLIENT + bool "Proxy solicitation feature" select BT_MESH_SOLICITATION help - This option enables support for sending Solicitation PDUs for Proxy Client. + This option enables support for sending Solicitation PDUs. config BT_MESH_SOL_ADV_XMIT int "Solicitation PDU retransmission count" diff --git a/subsys/bluetooth/mesh/shell/shell.c b/subsys/bluetooth/mesh/shell/shell.c index c5592db02cf..6ee825d4c09 100644 --- a/subsys/bluetooth/mesh/shell/shell.c +++ b/subsys/bluetooth/mesh/shell/shell.c @@ -387,6 +387,7 @@ static int cmd_proxy_disconnect(const struct shell *sh, size_t argc, return 0; } +#endif /* CONFIG_BT_MESH_PROXY_CLIENT */ #if defined(CONFIG_BT_MESH_PROXY_SOLICITATION) static int cmd_proxy_solicit(const struct shell *sh, size_t argc, @@ -410,7 +411,6 @@ static int cmd_proxy_solicit(const struct shell *sh, size_t argc, return err; } #endif /* CONFIG_BT_MESH_PROXY_SOLICITATION */ -#endif /* CONFIG_BT_MESH_PROXY_CLIENT */ #endif /* CONFIG_BT_MESH_SHELL_GATT_PROXY */ #if defined(CONFIG_BT_MESH_SHELL_PROV) @@ -1739,11 +1739,11 @@ SHELL_STATIC_SUBCMD_SET_CREATE(proxy_cmds, #if defined(CONFIG_BT_MESH_PROXY_CLIENT) SHELL_CMD_ARG(connect, NULL, "", cmd_proxy_connect, 2, 0), SHELL_CMD_ARG(disconnect, NULL, "", cmd_proxy_disconnect, 2, 0), +#endif #if defined(CONFIG_BT_MESH_PROXY_SOLICITATION) SHELL_CMD_ARG(solicit, NULL, "", cmd_proxy_solicit, 2, 0), -#endif #endif SHELL_SUBCMD_SET_END); #endif /* CONFIG_BT_MESH_SHELL_GATT_PROXY */