* Add a device to the current session.
*
* @param dev The device to add to the current session. Must not be NULL.
- * Also, dev->plugin and dev->plugin->dev_open must not be NULL.
+ * Also, dev->driver and dev->driver->dev_open must not be NULL.
*
* @return SR_OK upon success, SR_ERR_ARG upon invalid arguments.
*/
return SR_ERR_ARG;
}
- if (!dev->plugin) {
- sr_err("session: %s: dev->plugin was NULL", __func__);
+ if (!dev->driver) {
+ sr_err("session: %s: dev->driver was NULL", __func__);
return SR_ERR_ARG;
}
- if (!dev->plugin->dev_open) {
- sr_err("session: %s: dev->plugin->dev_open was NULL",
+ if (!dev->driver->dev_open) {
+ sr_err("session: %s: dev->driver->dev_open was NULL",
__func__);
return SR_ERR_ARG;
}
return SR_ERR; /* TODO: SR_ERR_BUG? */
}
- if ((ret = dev->plugin->dev_open(dev->plugin_index)) != SR_OK) {
+ if ((ret = dev->driver->dev_open(dev->driver_index)) != SR_OK) {
sr_err("session: %s: dev_open failed (%d)", __func__, ret);
return ret;
}
return SR_ERR; /* TODO: SR_ERR_BUG? */
}
- /* TODO: Check plugin_index validity? */
+ /* TODO: Check driver_index validity? */
sr_info("session: starting");
for (l = session->devs; l; l = l->next) {
dev = l->data;
/* TODO: Check for dev != NULL. */
- if ((ret = dev->plugin->dev_acquisition_start(
- dev->plugin_index, dev)) != SR_OK) {
+ if ((ret = dev->driver->dev_acquisition_start(
+ dev->driver_index, dev)) != SR_OK) {
sr_err("session: %s: could not start an acquisition "
"(%d)", __func__, ret);
break;
* Stop the current session.
*
* The current session is stopped immediately, with all acquisition sessions
- * being stopped and hardware plugins cleaned up.
+ * being stopped and hardware drivers cleaned up.
*
* @return SR_OK upon success, SR_ERR_BUG if no session exists.
*/
for (l = session->devs; l; l = l->next) {
dev = l->data;
/* Check for dev != NULL. */
- if (dev->plugin) {
- if (dev->plugin->dev_acquisition_stop)
- dev->plugin->dev_acquisition_stop(dev->plugin_index, dev);
- if (dev->plugin->cleanup)
- dev->plugin->cleanup();
+ if (dev->driver) {
+ if (dev->driver->dev_acquisition_stop)
+ dev->driver->dev_acquisition_stop(dev->driver_index, dev);
+ if (dev->driver->cleanup)
+ dev->driver->cleanup();
}
}
return SR_ERR_ARG;
}
- if (!dev->plugin) {
- sr_err("session: %s: dev->plugin was NULL", __func__);
+ if (!dev->driver) {
+ sr_err("session: %s: dev->driver was NULL", __func__);
return SR_ERR_ARG;
}