Hello,
In my project I am creating a BLE service with 7 characteristics that are all NOTIFY only characteristics.
My service setup looks like the following:
static void notifyStateChanged(const struct bt_gatt_attr *attr, uint16_t value) { struct bt_gatt_chrc *user_data = attr->user_data; bool enabled = (value==BT_GATT_CCC_NOTIFY); int mask = 0; if (bt_uuid_cmp(attr->uuid, MY_CHAR_1) == 0) { mask = MYCHAR1_NOTIFY_FLAG_SET; } else if (bt_uuid_cmp(attr->uuid, MY_CHAR_2) == 0) { mask = MYCHAR2_NOTIFY_FLAG_SET; } else ... { ... } if (enabled) { notificationFlags |= mask; } else { notificationFlags &= ~mask; } }