]> sigrok.org Git - libsigrok.git/blobdiff - src/std.c
Input/trace32_ad: Make the sample rate an option
[libsigrok.git] / src / std.c
index b66ed8f0b4884c603d4e235a972775c1a1ab40c6..aadf8236a790a3f79c38ece2cf6ebd191166991c 100644 (file)
--- a/src/std.c
+++ b/src/std.c
@@ -337,3 +337,22 @@ SR_PRIV int std_dev_clear(const struct sr_dev_driver *driver,
 
        return ret;
 }
+
+/**
+ * Standard implementation for the driver dev_list() callback
+ *
+ * This function can be used as the dev_list callback by most drivers that use
+ * the standard helper functions. It returns the devices contained in the driver
+ * context instances list.
+ *
+ * @param di The driver instance to use.
+ *
+ * @return The list of devices/instances of this driver, or NULL upon errors
+ *         or if the list is empty.
+ */
+SR_PRIV GSList *std_dev_list(const struct sr_dev_driver *di)
+{
+       struct drv_context *drvc = di->context;
+
+       return drvc->instances;
+}