+SR_API struct sr_trigger *sr_session_trigger_get(struct sr_session *session)
+{
+ return session->trigger;
+}
+
+SR_API int sr_session_trigger_set(struct sr_session *session, struct sr_trigger *trig)
+{
+ session->trigger = trig;
+
+ return SR_OK;
+}
+
+/**
+ * Call every device in the current session's callback.
+ *
+ * For sessions not driven by select loops such as sr_session_run(),
+ * but driven by another scheduler, this can be used to poll the devices
+ * from within that scheduler.
+ *
+ * @param block If TRUE, this call will wait for any of the session's
+ * sources to fire an event on the file descriptors, or
+ * any of their timeouts to activate. In other words, this
+ * can be used as a select loop.
+ * If FALSE, all sources have their callback run, regardless
+ * of file descriptor or timeout status.
+ *
+ * @retval SR_OK Success.
+ * @retval SR_ERR Error occured.
+ */
+static int sr_session_iteration(struct sr_session *session, gboolean block)