Skip to content

Commit c0ce5b4

Browse files
lylezhu2012aescolar
authored andcommitted
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]>
1 parent 0fe6d34 commit c0ce5b4

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
@@ -1746,6 +1746,17 @@ static inline const char *bt_security_err_to_str(enum bt_security_err err)
17461746
*/
17471747
void bt_set_bondable(bool enable);
17481748

1749+
/** @brief Get bonding flag.
1750+
*
1751+
* Get current bonding flag.
1752+
* The initial value of this flag depends on @kconfig{CONFIG_BT_BONDABLE} Kconfig
1753+
* setting.
1754+
* The Bonding flag can be updated using bt_set_bondable().
1755+
*
1756+
* @return Current bonding flag.
1757+
*/
1758+
bool bt_get_bondable(void);
1759+
17491760
/** @brief Set/clear the bonding flag for a given connection.
17501761
*
17511762
* 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
@@ -2659,6 +2659,11 @@ void bt_set_bondable(bool enable)
26592659
bondable = enable;
26602660
}
26612661

2662+
bool bt_get_bondable(void)
2663+
{
2664+
return bondable;
2665+
}
2666+
26622667
void bt_le_oob_set_sc_flag(bool enable)
26632668
{
26642669
sc_oobd_present = enable;

0 commit comments

Comments
 (0)