Skip to content

Commit eebe1bd

Browse files
lylezhu2012PavelVPV
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 fd4c862 commit eebe1bd

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
@@ -1863,6 +1863,17 @@ static inline const char *bt_security_err_to_str(enum bt_security_err err)
18631863
*/
18641864
void bt_set_bondable(bool enable);
18651865

1866+
/** @brief Get bonding flag.
1867+
*
1868+
* Get current bonding flag.
1869+
* The initial value of this flag depends on @kconfig{CONFIG_BT_BONDABLE} Kconfig
1870+
* setting.
1871+
* The Bonding flag can be updated using bt_set_bondable().
1872+
*
1873+
* @return Current bonding flag.
1874+
*/
1875+
bool bt_get_bondable(void);
1876+
18661877
/** @brief Set/clear the bonding flag for a given connection.
18671878
*
18681879
* 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)