]> sigrok.org Git - libsigrok.git/blobdiff - hardware/hameg-hmo/api.c
Replace 'probe group' with 'channel group' everywhere.
[libsigrok.git] / hardware / hameg-hmo / api.c
index fb2548af524796e1a7246ef972a775b6fa4abfea..243b8d6d39b78935a55a0d2f73e30138400df2d1 100644 (file)
@@ -183,32 +183,32 @@ static int cleanup(void)
        return SR_OK;
 }
 
-static int check_probe_group(struct dev_context *devc,
-                            const struct sr_probe_group *probe_group)
+static int check_channel_group(struct dev_context *devc,
+                            const struct sr_channel_group *channel_group)
 {
        unsigned int i;
        struct scope_config *model;
 
        model = devc->model_config;
 
-       if (!probe_group)
+       if (!channel_group)
                return PG_NONE;
 
        for (i = 0; i < model->analog_channels; ++i)
-               if (probe_group == &devc->analog_groups[i])
+               if (channel_group == &devc->analog_groups[i])
                        return PG_ANALOG;
 
        for (i = 0; i < model->digital_pods; ++i)
-               if (probe_group == &devc->digital_groups[i])
+               if (channel_group == &devc->digital_groups[i])
                        return PG_DIGITAL;
 
-       sr_err("Invalid probe group specified.");
+       sr_err("Invalid channel group specified.");
 
        return PG_INVALID;
 }
 
 static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
-                     const struct sr_probe_group *probe_group)
+                     const struct sr_channel_group *channel_group)
 {
        int ret, pg_type;
        unsigned int i;
@@ -219,7 +219,7 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
        if (!sdi || !(devc = sdi->priv))
                return SR_ERR_ARG;
 
-       if ((pg_type = check_probe_group(devc, probe_group)) == PG_INVALID)
+       if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID)
                return SR_ERR;
 
        ret = SR_ERR_NA;
@@ -238,11 +238,11 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
                break;
        case SR_CONF_NUM_VDIV:
                if (pg_type == PG_NONE) {
-                       sr_err("No probe group specified.");
-                       return SR_ERR_PROBE_GROUP;
+                       sr_err("No channel group specified.");
+                       return SR_ERR_CHANNEL_GROUP;
                } else if (pg_type == PG_ANALOG) {
                        for (i = 0; i < model->analog_channels; ++i) {
-                               if (probe_group != &devc->analog_groups[i])
+                               if (channel_group != &devc->analog_groups[i])
                                        continue;
                                *data = g_variant_new_int32(model->num_ydivs);
                                ret = SR_OK;
@@ -286,11 +286,11 @@ static int config_get(int key, GVariant **data, const struct sr_dev_inst *sdi,
                break;
        case SR_CONF_COUPLING:
                if (pg_type == PG_NONE) {
-                       sr_err("No probe group specified.");
-                       return SR_ERR_PROBE_GROUP;
+                       sr_err("No channel group specified.");
+                       return SR_ERR_CHANNEL_GROUP;
                } else if (pg_type == PG_ANALOG) {
                        for (i = 0; i < model->analog_channels; ++i) {
-                               if (probe_group != &devc->analog_groups[i])
+                               if (channel_group != &devc->analog_groups[i])
                                        continue;
                                *data = g_variant_new_string((*model->coupling_options)[state->analog_channels[i].coupling]);
                                ret = SR_OK;
@@ -332,7 +332,7 @@ static GVariant *build_tuples(const uint64_t (*array)[][2], unsigned int n)
 }
 
 static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
-                     const struct sr_probe_group *probe_group)
+                     const struct sr_channel_group *channel_group)
 {
        int ret, pg_type;
        unsigned int i, j;
@@ -348,7 +348,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
        if (!sdi || !(devc = sdi->priv))
                return SR_ERR_ARG;
 
-       if ((pg_type = check_probe_group(devc, probe_group)) == PG_INVALID)
+       if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID)
                return SR_ERR;
 
        model = devc->model_config;
@@ -378,8 +378,8 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
                break;
        case SR_CONF_VDIV:
                if (pg_type == PG_NONE) {
-                       sr_err("No probe group specified.");
-                       return SR_ERR_PROBE_GROUP;
+                       sr_err("No channel group specified.");
+                       return SR_ERR_CHANNEL_GROUP;
                }
 
                g_variant_get(data, "(tt)", &p, &q);
@@ -389,7 +389,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
                            q != (*model->vdivs)[i][1])
                                continue;
                        for (j = 1; j <= model->analog_channels; ++j) {
-                               if (probe_group != &devc->analog_groups[j - 1])
+                               if (channel_group != &devc->analog_groups[j - 1])
                                        continue;
                                state->analog_channels[j - 1].vdiv = i;
                                g_ascii_formatd(float_str, sizeof(float_str), "%E", (float) p / q);
@@ -461,8 +461,8 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
                break;
        case SR_CONF_COUPLING:
                if (pg_type == PG_NONE) {
-                       sr_err("No probe group specified.");
-                       return SR_ERR_PROBE_GROUP;
+                       sr_err("No channel group specified.");
+                       return SR_ERR_CHANNEL_GROUP;
                }
 
                tmp = g_variant_get_string(data, NULL);
@@ -471,7 +471,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
                        if (strcmp(tmp, (*model->coupling_options)[i]) != 0)
                                continue;
                        for (j = 1; j <= model->analog_channels; ++j) {
-                               if (probe_group != &devc->analog_groups[j - 1])
+                               if (channel_group != &devc->analog_groups[j - 1])
                                        continue;
                                state->analog_channels[j-1].coupling = i;
 
@@ -504,7 +504,7 @@ static int config_set(int key, GVariant *data, const struct sr_dev_inst *sdi,
 }
 
 static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
-                      const struct sr_probe_group *probe_group)
+                      const struct sr_channel_group *channel_group)
 {
        int pg_type;
        struct dev_context *devc;
@@ -513,7 +513,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
        if (!sdi || !(devc = sdi->priv))
                return SR_ERR_ARG;
 
-       if ((pg_type = check_probe_group(devc, probe_group)) == PG_INVALID)
+       if ((pg_type = check_channel_group(devc, channel_group)) == PG_INVALID)
                return SR_ERR;
 
        model = devc->model_config;
@@ -535,7 +535,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                break;
        case SR_CONF_COUPLING:
                if (pg_type == PG_NONE)
-                       return SR_ERR_PROBE_GROUP;
+                       return SR_ERR_CHANNEL_GROUP;
                *data = g_variant_new_strv(*model->coupling_options,
                           g_strv_length((char **)*model->coupling_options));
                break;
@@ -552,7 +552,7 @@ static int config_list(int key, GVariant **data, const struct sr_dev_inst *sdi,
                break;
        case SR_CONF_VDIV:
                if (pg_type == PG_NONE)
-                       return SR_ERR_PROBE_GROUP;
+                       return SR_ERR_CHANNEL_GROUP;
                *data = build_tuples(model->vdivs, model->num_vdivs);
                break;
        default: