Skip to content

Commit cc21ff5

Browse files
MarekPietacarlescufi
authored andcommitted
Bluetooth: GATT: Fix undefined symbols
Change fixes build issues for configurations without Bluetooth. Signed-off-by: Marek Pieta <[email protected]>
1 parent d9fa9c6 commit cc21ff5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

include/bluetooth/gatt.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,10 +622,12 @@ ssize_t bt_gatt_attr_read_chrc(struct bt_conn *conn,
622622
})), \
623623
BT_GATT_ATTRIBUTE(_uuid, _perm, _read, _write, _value)
624624

625-
#if IS_ENABLED(CONFIG_BT_SETTINGS_CCC_LAZY_LOADING)
625+
#if defined(CONFIG_BT_SETTINGS_CCC_LAZY_LOADING)
626626
#define BT_GATT_CCC_MAX (CONFIG_BT_MAX_CONN)
627-
#else
627+
#elif defined(CONFIG_BT_CONN)
628628
#define BT_GATT_CCC_MAX (CONFIG_BT_MAX_PAIRED + CONFIG_BT_MAX_CONN)
629+
#else
630+
#define BT_GATT_CCC_MAX 0
629631
#endif
630632

631633
/** @brief GATT CCC configuration entry. */

subsys/bluetooth/host/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ config BT_SETTINGS
206206
if BT_SETTINGS
207207
config BT_SETTINGS_CCC_LAZY_LOADING
208208
bool "Load CCC values from settings when peer connects"
209+
depends on BT_CONN
209210
default y
210211
help
211212
Load Client Configuration Characteristic setting right after a bonded
@@ -215,6 +216,7 @@ config BT_SETTINGS_CCC_LAZY_LOADING
215216

216217
config BT_SETTINGS_CCC_STORE_ON_WRITE
217218
bool "Store CCC value immediately after it has been written"
219+
depends on BT_CONN
218220
help
219221
Store Client Configuration Characteristic value right after it has
220222
been updated.

0 commit comments

Comments
 (0)