Skip to content

Commit

Permalink
bluetooth: scan: Add connect_if_match flag update function.
Browse files Browse the repository at this point in the history
Commit adds connet_if_match flag update function.

Jira: NCSDK-22434

Signed-off-by: Marcin Jelinski <marcin.jelinski@nordicsemi.no>
  • Loading branch information
maje-emb authored and cvinayak committed Jan 2, 2024
1 parent 4a0c34a commit eb80b0c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,10 @@ Bluetooth libraries and services

* The :ref:`bt_mesh_le_pair_resp_readme` model to allow passing a passkey used in LE pairing over a mesh network.

:ref:`nrf_bt_scan_readme`:

* Added the :c:func:`bt_scan_update_connect_if_match` function to update the autoconnect flag after a filter match.

Bootloader libraries
--------------------

Expand Down
9 changes: 9 additions & 0 deletions include/bluetooth/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,15 @@ int bt_scan_blocklist_device_add(const bt_addr_le_t *addr);
*/
void bt_scan_blocklist_clear(void);

/**@brief Function to update the autoconnect flag after a filter match.
*
* @note The function should not be used when scanning is active.
*
* @param[in] connect_if_match If set to true, the module automatically
* connects after a filter match.
*/
void bt_scan_update_connect_if_match(bool connect_if_match);

#ifdef __cplusplus
}
#endif
Expand Down
7 changes: 7 additions & 0 deletions subsys/bluetooth/scan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1630,3 +1630,10 @@ void bt_scan_conn_attempts_filter_clear(void)
k_mutex_unlock(&scan_mutex);
}
#endif /* CONFIG_BT_SCAN_CONN_ATTEMPTS_FILTER */

#if CONFIG_BT_CENTRAL
void bt_scan_update_connect_if_match(bool connect_if_match)
{
bt_scan.connect_if_match = connect_if_match;
}
#endif /* CONFIG_BT_CENTRAL */

0 comments on commit eb80b0c

Please sign in to comment.