Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/releases/release-notes-4.3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Removed APIs and options
* The TinyCrypt library was removed as the upstream version is no longer maintained.
PSA Crypto API is now the recommended cryptographic library for Zephyr.
* The legacy pipe object API was removed. Use the new pipe API instead.
* ``bt_le_set_auto_conn``

Deprecated APIs and options
===========================
Expand Down
17 changes: 0 additions & 17 deletions include/zephyr/bluetooth/conn.h
Original file line number Diff line number Diff line change
Expand Up @@ -1639,23 +1639,6 @@ int bt_conn_le_create_auto(const struct bt_conn_le_create_param *create_param,
*/
int bt_conn_create_auto_stop(void);

/** @brief Automatically connect to remote device if it's in range.
*
* This function enables/disables automatic connection initiation.
* Every time the device loses the connection with peer, this connection
* will be re-established if connectable advertisement from peer is received.
*
* @note Auto connect is disabled during explicit scanning.
*
* @param addr Remote Bluetooth address.
* @param param If non-NULL, auto connect is enabled with the given
* parameters. If NULL, auto connect is disabled.
*
* @return Zero on success or error code otherwise.
*/
__deprecated int bt_le_set_auto_conn(const bt_addr_le_t *addr,
const struct bt_le_conn_param *param);

/** @brief Set security level for a connection.
*
* This function enable security (encryption) for a connection. If the device
Expand Down
59 changes: 0 additions & 59 deletions subsys/bluetooth/host/conn.c
Original file line number Diff line number Diff line change
Expand Up @@ -3994,65 +3994,6 @@ int bt_conn_le_create_synced(const struct bt_le_ext_adv *adv,
*ret_conn = conn;
return 0;
}

#if !defined(CONFIG_BT_FILTER_ACCEPT_LIST)
int bt_le_set_auto_conn(const bt_addr_le_t *addr,
const struct bt_le_conn_param *param)
{
struct bt_conn *conn;

if (!atomic_test_bit(bt_dev.flags, BT_DEV_READY)) {
return -EAGAIN;
}

if (param && !bt_le_conn_params_valid(param)) {
return -EINVAL;
}

if (!bt_id_scan_random_addr_check()) {
return -EINVAL;
}

/* Only default identity is supported */
conn = bt_conn_lookup_addr_le(BT_ID_DEFAULT, addr);
if (!conn) {
conn = bt_conn_add_le(BT_ID_DEFAULT, addr);
if (!conn) {
return -ENOMEM;
}
}

if (param) {
bt_conn_set_param_le(conn, param);

if (!atomic_test_and_set_bit(conn->flags,
BT_CONN_AUTO_CONNECT)) {
bt_conn_ref(conn);
}
} else {
if (atomic_test_and_clear_bit(conn->flags,
BT_CONN_AUTO_CONNECT)) {
bt_conn_unref(conn);
if (conn->state == BT_CONN_SCAN_BEFORE_INITIATING) {
bt_conn_set_state(conn, BT_CONN_DISCONNECTED);
}
}
}

int err = 0;
if (conn->state == BT_CONN_DISCONNECTED &&
atomic_test_bit(bt_dev.flags, BT_DEV_READY)) {
if (param) {
bt_conn_set_state(conn, BT_CONN_SCAN_BEFORE_INITIATING);
err = bt_le_scan_user_add(BT_LE_SCAN_USER_CONN);
}
}

bt_conn_unref(conn);

return err;
}
#endif /* !defined(CONFIG_BT_FILTER_ACCEPT_LIST) */
#endif /* CONFIG_BT_CENTRAL */

int bt_conn_le_conn_update(struct bt_conn *conn,
Expand Down