]> sigrok.org Git - libsigrok.git/blobdiff - session_driver.c
sr/cli/gtk/qt: s/get_dev_info/dev_info_get/.
[libsigrok.git] / session_driver.c
index 647de88221a364d79f4ae6167d67e41d4acd18df..e8c4d2ecb48f220c0ac461ade466df6edc5f1252 100644 (file)
@@ -41,7 +41,7 @@ struct session_vdev {
 
 static char *sessionfile = NULL;
 static GSList *dev_insts = NULL;
-static int capabilities[] = {
+static int hwcaps[] = {
        SR_HWCAP_CAPTUREFILE,
        SR_HWCAP_CAPTURE_UNITSIZE,
        0,
@@ -194,7 +194,7 @@ static int hw_opendev(int dev_index)
        return SR_OK;
 }
 
-static void *hw_get_dev_info(int dev_index, int dev_info_id)
+static void *hw_dev_info_get(int dev_index, int dev_info_id)
 {
        struct session_vdev *vdev;
        void *info;
@@ -227,12 +227,12 @@ static int hw_get_status(int dev_index)
  * @return A pointer to the (hardware) capabilities of this virtual session
  *         driver. This could be NULL, if no such capabilities exist.
  */
-static int *hw_get_capabilities(void)
+static int *hw_hwcap_get_all(void)
 {
-       return capabilities;
+       return hwcaps;
 }
 
-static int hw_set_configuration(int dev_index, int capability, void *value)
+static int hw_config_set(int dev_index, int hwcap, void *value)
 {
        struct session_vdev *vdev;
        uint64_t *tmp_u64;
@@ -240,7 +240,7 @@ static int hw_set_configuration(int dev_index, int capability, void *value)
        if (!(vdev = get_vdev_by_index(dev_index)))
                return SR_ERR;
 
-       switch (capability) {
+       switch (hwcap) {
        case SR_HWCAP_SAMPLERATE:
                tmp_u64 = value;
                vdev->samplerate = *tmp_u64;
@@ -262,7 +262,7 @@ static int hw_set_configuration(int dev_index, int capability, void *value)
                break;
        default:
                sr_err("session driver: %s: unknown capability %d requested",
-                      __func__, capability);
+                      __func__, hwcap);
                return SR_ERR;
        }
 
@@ -332,17 +332,17 @@ static int hw_start_acquisition(int dev_index, gpointer session_dev_id)
 }
 
 SR_PRIV struct sr_dev_plugin session_driver = {
-       "session",
-       "Session-emulating driver",
-       1,
-       hw_init,
-       hw_cleanup,
-       hw_opendev,
-       NULL,
-       hw_get_dev_info,
-       hw_get_status,
-       hw_get_capabilities,
-       hw_set_configuration,
-       hw_start_acquisition,
-       NULL,
+       .name = "session",
+       .longname = "Session-emulating driver",
+       .api_version = 1,
+       .init = hw_init,
+       .cleanup = hw_cleanup,
+       .opendev = hw_opendev,
+       .closedev = NULL,
+       .dev_info_get = hw_dev_info_get,
+       .get_status = hw_get_status,
+       .hwcap_get_all = hw_hwcap_get_all,
+       .config_set = hw_config_set,
+       .start_acquisition = hw_start_acquisition,
+       .stop_acquisition = NULL,
 };