From e24ab4e0e3e1702b61a4ca4028d91c53d62c8f5d Mon Sep 17 00:00:00 2001 From: Gabor Hornyak Date: Wed, 6 Apr 2022 21:23:38 +0000 Subject: [PATCH] fix: peripheral battery level notification --- app/src/battery_split.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/src/battery_split.c b/app/src/battery_split.c index 0af51f46..ac37d7d2 100644 --- a/app/src/battery_split.c +++ b/app/src/battery_split.c @@ -57,7 +57,9 @@ int peripheral_batt_lvl_listener(const zmk_event_t *eh) { }; LOG_DBG("Peripheral battery level event: %u", ev->state_of_charge); last_state_of_peripheral_charge = ev->state_of_charge; - int rc = bt_gatt_notify(NULL, &bas.attrs[3], &last_state_of_peripheral_charge, + + // TODO: super fragile because of hardcoded attribute index + int rc = bt_gatt_notify(NULL, &bas.attrs[5], &last_state_of_peripheral_charge, sizeof(last_state_of_peripheral_charge)); return rc; };