Skip to content

Commit d8e4bc7

Browse files
niym-otcarlescufi
authored andcommitted
bluetooth: BAS: add gatt notify for battery level status char
gatt notification for battery level status char is added in battery service. Signed-off-by: Nithin Ramesh Myliattil <[email protected]>
1 parent 6ae753f commit d8e4bc7

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

subsys/bluetooth/services/bas/bas_bls.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,21 @@ static void bt_bas_bls_update_battery_level_status(void)
121121
#endif
122122
};
123123

124-
/* Notify/Indicate all connections */
124+
/* Indicate all connections */
125125
ind_params.attr = attr;
126126
ind_params.data = &le_battery_level_status;
127127
ind_params.len = sizeof(le_battery_level_status);
128128
ind_params.func = indicate_cb;
129129
err = bt_gatt_indicate(NULL, &ind_params);
130130
if (err) {
131-
LOG_DBG("Failed to send ntf/ind to all connections (err %d)\n", err);
131+
LOG_DBG("Failed to send ind to all connections (err %d)\n", err);
132+
}
133+
134+
/* Notify all connections */
135+
err = bt_gatt_notify(NULL, attr, &le_battery_level_status,
136+
sizeof(le_battery_level_status));
137+
if (err) {
138+
LOG_DBG("Failed to send ntf to all connections (err %d)\n", err);
132139
}
133140
}
134141
}

0 commit comments

Comments
 (0)