From c14da53772366cde8e42f3e3b59cf7f4db7ce8e4 Mon Sep 17 00:00:00 2001 From: Joakim Andersson Date: Wed, 20 Jan 2021 16:43:04 +0100 Subject: [PATCH] Bluetooth: host: Remove the deprecated bt_conn_create_slave_le function Remove the deprecated bt_conn_create_slave_le function. This was deprecated in the 2.3.0 release. Signed-off-by: Joakim Andersson --- doc/releases/release-notes-2.5.rst | 3 +++ include/bluetooth/conn.h | 39 ------------------------------ subsys/bluetooth/host/conn.c | 11 --------- 3 files changed, 3 insertions(+), 50 deletions(-) diff --git a/doc/releases/release-notes-2.5.rst b/doc/releases/release-notes-2.5.rst index a6149ec08a..f7341fe77c 100644 --- a/doc/releases/release-notes-2.5.rst +++ b/doc/releases/release-notes-2.5.rst @@ -105,6 +105,9 @@ Removed APIs in this release use bt_conn_le_create() instead. * The deprecated bt_conn_create_auto_le() function has been removed, use bt_conn_le_create_auto() instead. + * The deprecated bt_conn_create_slave_le() function has been removed, + use bt_le_adv_start() instead with bt_le_adv_param::peer set to the remote + peers address. * The deprecated BT_LE_ADV_* macros have been removed, use the BT_GAP_ADV_* enums instead. * The deprecated bt_conn_security function has been removed, diff --git a/include/bluetooth/conn.h b/include/bluetooth/conn.h index b1fc921378..3f74e4c60d 100644 --- a/include/bluetooth/conn.h +++ b/include/bluetooth/conn.h @@ -653,45 +653,6 @@ int bt_conn_create_auto_stop(void); int bt_le_set_auto_conn(const bt_addr_le_t *addr, const struct bt_le_conn_param *param); -/** @brief Initiate directed advertising to a remote device - * - * Allows initiating a new LE connection to remote peer with the remote - * acting in central role and the local device in peripheral role. - * - * The advertising type will either be BT_LE_ADV_DIRECT_IND, or - * BT_LE_ADV_DIRECT_IND_LOW_DUTY if the BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY - * option was used as part of the advertising parameters. - * - * In case of high duty cycle this will result in a callback with - * connected() with a new connection or with an error. - * - * The advertising may be canceled with bt_conn_disconnect(). - * - * The caller gets a new reference to the connection object which must be - * released with bt_conn_unref() once done using the object. - * - * @param peer Remote address. - * @param param Directed advertising parameters. - * - * @return Valid connection object on success or NULL otherwise. - */ -__deprecated static inline -struct bt_conn *bt_conn_create_slave_le(const bt_addr_le_t *peer, - const struct bt_le_adv_param *param) -{ - struct bt_le_adv_param adv_param = *param; - - adv_param.options |= (BT_LE_ADV_OPT_CONNECTABLE | - BT_LE_ADV_OPT_ONE_TIME); - adv_param.peer = peer; - - if (!bt_le_adv_start(&adv_param, NULL, 0, NULL, 0)) { - return NULL; - } - - return bt_conn_lookup_addr_le(param->id, peer); -} - /** Security level. */ typedef enum __packed { /** Level 0: Only for BR/EDR special cases, like SDP */ diff --git a/subsys/bluetooth/host/conn.c b/subsys/bluetooth/host/conn.c index c414e09ffc..c03851b060 100644 --- a/subsys/bluetooth/host/conn.c +++ b/subsys/bluetooth/host/conn.c @@ -2158,17 +2158,6 @@ int bt_conn_disconnect(struct bt_conn *conn, uint8_t reason) bt_le_scan_update(false); } return 0; - case BT_CONN_CONNECT_DIR_ADV: - BT_WARN("Deprecated: Use bt_le_adv_stop instead"); - conn->err = reason; - bt_conn_set_state(conn, BT_CONN_DISCONNECTED); - if (IS_ENABLED(CONFIG_BT_PERIPHERAL)) { - /* User should unref connection object when receiving - * error in connection callback. - */ - return bt_le_adv_stop(); - } - return 0; case BT_CONN_CONNECT: #if defined(CONFIG_BT_BREDR) if (conn->type == BT_CONN_TYPE_BR) {