Skip to content

Commit de960b8

Browse files
committed
Bluetooth: Classic: fix dynamic local name compilation
Add missing function declaration for bt_br_write_local_name() to resolve compilation errors when CONFIG_BT_DEVICE_NAME_DYNAMIC is enabled. The function is now properly declared in classic.h header file to avoid implicit declaration warnings. Signed-off-by: Kai Cheng <[email protected]>
1 parent 45765b6 commit de960b8

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

subsys/bluetooth/host/hci_core.c

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848

4949
#include "addr_internal.h"
5050
#include "adv.h"
51+
#include "classic/br.h"
5152
#include "common/hci_common_internal.h"
5253
#include "common/bt_str.h"
5354
#include "common/rpa.h"
@@ -66,10 +67,6 @@
6667
#include "settings.h"
6768
#include "smp.h"
6869

69-
#if defined(CONFIG_BT_CLASSIC)
70-
#include "classic/br.h"
71-
#endif
72-
7370
#if defined(CONFIG_BT_DF)
7471
#include "direction_internal.h"
7572
#endif /* CONFIG_BT_DF */
@@ -3888,10 +3885,9 @@ static int le_init(void)
38883885
return le_set_event_mask();
38893886
}
38903887

3891-
#if !defined(CONFIG_BT_CLASSIC)
3892-
static int bt_br_init(void)
3888+
static int br_init(void)
38933889
{
3894-
#if defined(CONFIG_BT_CONN)
3890+
#if !defined(CONFIG_BT_CLASSIC) && defined(CONFIG_BT_CONN)
38953891
struct net_buf *rsp;
38963892
int err;
38973893

@@ -3907,11 +3903,10 @@ static int bt_br_init(void)
39073903

39083904
read_buffer_size_complete(rsp);
39093905
net_buf_unref(rsp);
3910-
#endif /* CONFIG_BT_CONN */
3906+
#endif /* !CONFIG_BT_CLASSIC && CONFIG_BT_CONN */
39113907

39123908
return 0;
39133909
}
3914-
#endif /* !defined(CONFIG_BT_CLASSIC) */
39153910

39163911
static int set_event_mask(void)
39173912
{
@@ -4198,7 +4193,7 @@ static int hci_init(void)
41984193
}
41994194

42004195
if (BT_FEAT_BREDR(bt_dev.features)) {
4201-
err = bt_br_init();
4196+
err = br_init();
42024197
if (err) {
42034198
return err;
42044199
}

0 commit comments

Comments
 (0)