I would like to add dynamically notify callbacks on a given characteristic.
Currently I can only register one callback on the creation of the characteristic:
static void active_ccc_cfg_changed(const struct bt_gatt_attr *attr, uint16_t value) {
ARG_UNUSED(attr);
bool notif_enabled = (value == BT_GATT_CCC_NOTIFY);
LOG_INF("ACTIVE notifications %s", notif_enabled ? "enabled" : "disabled");
}
...
BT_GATT_CCC(active_ccc_cfg_changed, BT_GATT_PERM_READ | BT_GATT_PERM_WRITE)
How can I add a callback for ccc changes during runtime for a given characteristic?