sr_info("session: starting");
+ ret = SR_OK;
for (l = session->devs; l; l = l->next) {
sdi = l->data;
if ((ret = sdi->driver->dev_acquisition_start(sdi, sdi)) != SR_OK) {
}
}
+ /*
+ * Some sources may not be necessarily associated with a device.
+ * Those sources may still be present even after stopping all devices.
+ * We need to make sure all sources are removed, or we risk running the
+ * session in an infinite loop.
+ */
+ while (session->num_sources)
+ sr_session_source_remove(session->sources[0].poll_object);
+
return SR_OK;
}
*
* @param packet The packet to show debugging information for.
*/
-static void datafeed_dump(struct sr_datafeed_packet *packet)
+static void datafeed_dump(const struct sr_datafeed_packet *packet)
{
- struct sr_datafeed_logic *logic;
- struct sr_datafeed_analog *analog;
+ const struct sr_datafeed_logic *logic;
+ const struct sr_datafeed_analog *analog;
switch (packet->type) {
case SR_DF_HEADER:
* @private
*/
SR_PRIV int sr_session_send(const struct sr_dev_inst *sdi,
- struct sr_datafeed_packet *packet)
+ const struct sr_datafeed_packet *packet)
{
GSList *l;
sr_datafeed_callback_t cb;