fix: peripheral battery level notification

This commit is contained in:
Gabor Hornyak 2022-04-06 21:23:38 +00:00
parent 23bef8a85d
commit e24ab4e0e3

View file

@ -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;
};