+ return status;
+}
+
+BT_HIDDEN
+enum bt_self_notification_iterator_status dmesg_notif_iter_next(
+ bt_self_notification_iterator *self_notif_iter,
+ bt_notification_array_const notifs, uint64_t capacity,
+ uint64_t *count)
+{
+ struct dmesg_notif_iter *dmesg_notif_iter =
+ bt_self_notification_iterator_get_data(
+ self_notif_iter);
+ enum bt_self_notification_iterator_status status =
+ BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK;
+ uint64_t i = 0;
+
+ while (i < capacity &&
+ status == BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK) {
+ bt_notification *priv_notif = NULL;
+
+ status = dmesg_notif_iter_next_one(dmesg_notif_iter,
+ &priv_notif);
+ notifs[i] = priv_notif;
+ if (status == BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK) {
+ i++;
+ }
+ }
+
+ if (i > 0) {
+ /*
+ * Even if dmesg_notif_iter_next_one() returned
+ * something else than
+ * BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK, we
+ * accumulated notification objects in the output
+ * notification array, so we need to return
+ * BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK so that they
+ * are transfered to downstream. This other status
+ * occurs again the next time muxer_notif_iter_do_next()
+ * is called, possibly without any accumulated
+ * notification, in which case we'll return it.
+ */
+ *count = i;
+ status = BT_SELF_NOTIFICATION_ITERATOR_STATUS_OK;
+ }
+
+ return status;