]> sigrok.org Git - libsigrok.git/blobdiff - hardware/gmc-mh-1x-2x/api.c
rigol-ds: Add the TRIGGER_SLOPE entry to config_get() and config_list()
[libsigrok.git] / hardware / gmc-mh-1x-2x / api.c
index e79bdbcf550bf2ce237783d1c45e30a5cc2cd46f..ec12ab2fa06128e83d88494281e3db6e632af74f 100644 (file)
@@ -162,7 +162,7 @@ static GSList *scan_1x_2x_rs232(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
-       struct sr_probe *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        const char *conn, *serialcomm;
@@ -240,9 +240,9 @@ static GSList *scan_1x_2x_rs232(GSList *options)
                sdi->conn = serial;
                sdi->priv = devc;
                sdi->driver = &gmc_mh_1x_2x_rs232_driver_info;
-               if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+               if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                        return NULL;
-               sdi->probes = g_slist_append(sdi->probes, probe);
+               sdi->channels = g_slist_append(sdi->channels, ch);
                drvc->instances = g_slist_append(drvc->instances, sdi);
                devices = g_slist_append(devices, sdi);
        }
@@ -259,7 +259,7 @@ static GSList *scan_2x_bd232(GSList *options)
        struct drv_context *drvc;
        struct dev_context *devc;
        struct sr_config *src;
-       struct sr_probe *probe;
+       struct sr_channel *ch;
        struct sr_serial_dev_inst *serial;
        GSList *l, *devices;
        const char *conn, *serialcomm;
@@ -343,9 +343,9 @@ static GSList *scan_2x_bd232(GSList *options)
                        sdi->conn = serial;
                        sdi->priv = devc;
                        sdi->driver = &gmc_mh_2x_bd232_driver_info;
-                       if (!(probe = sr_probe_new(0, SR_PROBE_ANALOG, TRUE, "P1")))
+                       if (!(ch = sr_channel_new(0, SR_CHANNEL_ANALOG, TRUE, "P1")))
                                goto exit_err;
-                       sdi->probes = g_slist_append(sdi->probes, probe);
+                       sdi->channels = g_slist_append(sdi->channels, ch);
                        drvc->instances = g_slist_append(drvc->instances, sdi);
                        devices = g_slist_append(devices, sdi);
 
@@ -423,18 +423,18 @@ static int cleanup_2x_bd232(void)
 
 /** Get value of configuration item */
 static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
-                     const struct sr_channel_group *channel_group)
+                     const struct sr_channel_group *cg)
 {
        int ret;
        struct dev_context *devc;
 
        (void)sdi;
        (void)data;
-       (void)channel_group;
+       (void)cg;
 
        ret = SR_OK;
 
-       (void)channel_group;
+       (void)cg;
 
        if (!sdi || !(devc = sdi->priv))
                return SR_ERR_ARG;
@@ -460,10 +460,10 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
 
 /** Implementation of config_list, auxiliary function for common parts, */
 static int config_list_common(int key, GVariant **data, const struct sr_dev_inst *sdi,
-                             const struct sr_channel_group *channel_group)
+                             const struct sr_channel_group *cg)
 {
        (void)sdi;
-       (void)channel_group;
+       (void)cg;
 
        switch (key) {
        case SR_CONF_SCAN_OPTIONS:
@@ -479,10 +479,9 @@ static int config_list_common(int key, GVariant **data, const struct sr_dev_inst
 
 /** Implementation of config_list for Metrahit 1x/2x send mode */
 static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sdi,
-                         const struct sr_channel_group *channel_group)
+                         const struct sr_channel_group *cg)
 {
        (void)sdi;
-       (void)channel_group;
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
@@ -490,7 +489,7 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd
                                                  hwcaps_sm, ARRAY_SIZE(hwcaps_sm), sizeof(int32_t));
                break;
        default:
-               return config_list_common(key, data, sdi, channel_group);
+               return config_list_common(key, data, sdi, cg);
        }
 
        return SR_OK;
@@ -498,10 +497,9 @@ static int config_list_sm(int key, GVariant **data, const struct sr_dev_inst *sd
 
 /** Implementation of config_list for Metrahit 2x bidirectional mode */
 static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sdi,
-                         const struct sr_channel_group *channel_group)
+                         const struct sr_channel_group *cg)
 {
        (void)sdi;
-       (void)channel_group;
 
        switch (key) {
        case SR_CONF_DEVICE_OPTIONS:
@@ -509,7 +507,7 @@ static int config_list_bd(int key, GVariant **data, const struct sr_dev_inst *sd
                                                  hwcaps_bd, ARRAY_SIZE(hwcaps_bd), sizeof(int32_t));
                break;
        default:
-               return config_list_common(key, data, sdi, channel_group);
+               return config_list_common(key, data, sdi, cg);
        }
 
        return SR_OK;