Skip to content

Commit 5a9709c

Browse files
committed
bluetooth: lbs: fix button characteristic properties
When CONFIG_BT_LBS_POLL_BUTTON is not set, the Button characteristic was declared with BT_GATT_CHRC_READ in its properties, advertising to peers that the characteristic is readable. However, the read callback and user data are both NULL in this configuration, causing Zephyr's GATT host to return BT_ATT_ERR_READ_NOT_PERMITTED on any read attempt. Remove BT_GATT_CHRC_READ from the #else branch so that only BT_GATT_CHRC_NOTIFY is advertised when button state polling is not enabled. Fixes: KRKNWK-21157 Signed-off-by: Łukasz Duda <lukasz.duda@nordicsemi.no>
1 parent 7bbd02a commit 5a9709c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • subsys/bluetooth/services

subsys/bluetooth/services/lbs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ BT_GATT_PRIMARY_SERVICE(BT_UUID_LBS),
104104
&button_state),
105105
#else
106106
BT_GATT_CHARACTERISTIC(BT_UUID_LBS_BUTTON,
107-
BT_GATT_CHRC_READ | BT_GATT_CHRC_NOTIFY,
108-
BT_GATT_PERM_READ, NULL, NULL, NULL),
107+
BT_GATT_CHRC_NOTIFY,
108+
BT_GATT_PERM_NONE, NULL, NULL, NULL),
109109
#endif
110110
BT_GATT_CCC(lbslc_ccc_cfg_changed,
111111
BT_GATT_PERM_READ | BT_GATT_PERM_WRITE),

0 commit comments

Comments
 (0)