fix: peripheral battery level notification
This commit is contained in:
parent
23bef8a85d
commit
e24ab4e0e3
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
LOG_DBG("Peripheral battery level event: %u", ev->state_of_charge);
|
||||||
last_state_of_peripheral_charge = 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));
|
sizeof(last_state_of_peripheral_charge));
|
||||||
return rc;
|
return rc;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Reference in a new issue