Skip to content

Commit 2e4a644

Browse files
lylezhu2012rlubos
authored andcommitted
[nrf fromtree] Bluetooth: Host: smp: Add function to get bonding setting
Add a function bt_get_bondable to get the bonding setting. Signed-off-by: Lyle Zhu <[email protected]> (cherry picked from commit c0ce5b4)
1 parent 08fbd11 commit 2e4a644

File tree

2 files changed

+16
-0
lines changed
  • include/zephyr/bluetooth
  • subsys/bluetooth/host

2 files changed

+16
-0
lines changed

include/zephyr/bluetooth/conn.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1980,6 +1980,17 @@ static inline const char *bt_security_err_to_str(enum bt_security_err err)
19801980
*/
19811981
void bt_set_bondable(bool enable);
19821982

1983+
/** @brief Get bonding flag.
1984+
*
1985+
* Get current bonding flag.
1986+
* The initial value of this flag depends on @kconfig{CONFIG_BT_BONDABLE} Kconfig
1987+
* setting.
1988+
* The Bonding flag can be updated using bt_set_bondable().
1989+
*
1990+
* @return Current bonding flag.
1991+
*/
1992+
bool bt_get_bondable(void);
1993+
19831994
/** @brief Set/clear the bonding flag for a given connection.
19841995
*
19851996
* Set/clear the Bonding flag in the Authentication Requirements of

subsys/bluetooth/host/smp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2639,6 +2639,11 @@ void bt_set_bondable(bool enable)
26392639
bondable = enable;
26402640
}
26412641

2642+
bool bt_get_bondable(void)
2643+
{
2644+
return bondable;
2645+
}
2646+
26422647
void bt_le_oob_set_sc_flag(bool enable)
26432648
{
26442649
sc_oobd_present = enable;

0 commit comments

Comments
 (0)