Skip to content

Commit 360880b

Browse files
Thalleyjhedberg
authored andcommitted
Bluetooth: Host: Remove bt_le_set_auto_conn
Remove the deprecated function bt_le_set_auto_conn as it has been deprecated since 4.1. Signed-off-by: Emil Gydesen <[email protected]>
1 parent 47a7038 commit 360880b

File tree

2 files changed

+0
-76
lines changed

2 files changed

+0
-76
lines changed

include/zephyr/bluetooth/conn.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1639,23 +1639,6 @@ int bt_conn_le_create_auto(const struct bt_conn_le_create_param *create_param,
16391639
*/
16401640
int bt_conn_create_auto_stop(void);
16411641

1642-
/** @brief Automatically connect to remote device if it's in range.
1643-
*
1644-
* This function enables/disables automatic connection initiation.
1645-
* Every time the device loses the connection with peer, this connection
1646-
* will be re-established if connectable advertisement from peer is received.
1647-
*
1648-
* @note Auto connect is disabled during explicit scanning.
1649-
*
1650-
* @param addr Remote Bluetooth address.
1651-
* @param param If non-NULL, auto connect is enabled with the given
1652-
* parameters. If NULL, auto connect is disabled.
1653-
*
1654-
* @return Zero on success or error code otherwise.
1655-
*/
1656-
__deprecated int bt_le_set_auto_conn(const bt_addr_le_t *addr,
1657-
const struct bt_le_conn_param *param);
1658-
16591642
/** @brief Set security level for a connection.
16601643
*
16611644
* This function enable security (encryption) for a connection. If the device

subsys/bluetooth/host/conn.c

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -3994,65 +3994,6 @@ int bt_conn_le_create_synced(const struct bt_le_ext_adv *adv,
39943994
*ret_conn = conn;
39953995
return 0;
39963996
}
3997-
3998-
#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
3999-
int bt_le_set_auto_conn(const bt_addr_le_t *addr,
4000-
const struct bt_le_conn_param *param)
4001-
{
4002-
struct bt_conn *conn;
4003-
4004-
if (!atomic_test_bit(bt_dev.flags, BT_DEV_READY)) {
4005-
return -EAGAIN;
4006-
}
4007-
4008-
if (param && !bt_le_conn_params_valid(param)) {
4009-
return -EINVAL;
4010-
}
4011-
4012-
if (!bt_id_scan_random_addr_check()) {
4013-
return -EINVAL;
4014-
}
4015-
4016-
/* Only default identity is supported */
4017-
conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, addr);
4018-
if (!conn) {
4019-
conn = bt_conn_add_le(BT_ID_DEFAULT, addr);
4020-
if (!conn) {
4021-
return -ENOMEM;
4022-
}
4023-
}
4024-
4025-
if (param) {
4026-
bt_conn_set_param_le(conn, param);
4027-
4028-
if (!atomic_test_and_set_bit(conn->flags,
4029-
BT_CONN_AUTO_CONNECT)) {
4030-
bt_conn_ref(conn);
4031-
}
4032-
} else {
4033-
if (atomic_test_and_clear_bit(conn->flags,
4034-
BT_CONN_AUTO_CONNECT)) {
4035-
bt_conn_unref(conn);
4036-
if (conn->state == BT_CONN_SCAN_BEFORE_INITIATING) {
4037-
bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
4038-
}
4039-
}
4040-
}
4041-
4042-
int err = 0;
4043-
if (conn->state == BT_CONN_DISCONNECTED &&
4044-
atomic_test_bit(bt_dev.flags, BT_DEV_READY)) {
4045-
if (param) {
4046-
bt_conn_set_state(conn, BT_CONN_SCAN_BEFORE_INITIATING);
4047-
err = bt_le_scan_user_add(BT_LE_SCAN_USER_CONN);
4048-
}
4049-
}
4050-
4051-
bt_conn_unref(conn);
4052-
4053-
return err;
4054-
}
4055-
#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
40563997
#endif /* CONFIG_BT_CENTRAL */
40573998

40583999
int bt_conn_le_conn_update(struct bt_conn *conn,

0 commit comments

Comments
 (0)