samples/bluetooth: st_ble_sensor: Fixes the button activity notification

This commit fixes the button activity notification not working issue.
The right attribute(4) is used for the button service.
This has been tested on nucleo_wb55rg and disco_l475_iot1 platforms.

Signed-off-by: Krishna Mohan Dani <krishnamohan.d@hcl.com>
This commit is contained in:
Krishna Mohan Dani 2021-07-09 13:14:58 +05:30 committed by Johan Hedberg
commit 4268592dc2

View file

@ -118,7 +118,7 @@ static void button_callback(const struct device *gpiob, struct gpio_callback *cb
LOG_INF("Button pressed"); LOG_INF("Button pressed");
if (conn) { if (conn) {
if (notify_enable) { if (notify_enable) {
err = bt_gatt_notify(NULL, &stsensor_svc.attrs[2], err = bt_gatt_notify(NULL, &stsensor_svc.attrs[4],
&but_val, sizeof(but_val)); &but_val, sizeof(but_val));
if (err) { if (err) {
LOG_ERR("Notify error: %d", err); LOG_ERR("Notify error: %d", err);