]> sigrok.org Git - libsigrok.git/blobdiff - hardware/teleinfo/protocol.c
Rename 'struct sr_probe' to 'struct sr_channel' everywhere.
[libsigrok.git] / hardware / teleinfo / protocol.c
index 0d7e6ce53da7bdfbf2f1c0ad78f646bf14c06d52..5e0fa5e5a526773ec2b64a1ddb1bc8ed53fcdae5 100644 (file)
@@ -41,12 +41,12 @@ static gboolean teleinfo_control_check(char *label, char *data, char control)
 
 static gint teleinfo_probe_compare(gconstpointer a, gconstpointer b)
 {
-       const struct sr_probe *probe = a;
+       const struct sr_channel *probe = a;
        const char *name = b;
        return strcmp(probe->name, name);
 }
 
-static struct sr_probe *teleinfo_find_probe(struct sr_dev_inst *sdi,
+static struct sr_channel *teleinfo_find_probe(struct sr_dev_inst *sdi,
                                             const char *name)
 {
        GSList *elem = g_slist_find_custom(sdi->probes, name,
@@ -57,14 +57,18 @@ static struct sr_probe *teleinfo_find_probe(struct sr_dev_inst *sdi,
 static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *probe_name,
                                 float value, int mq, int unit)
 {
-       struct dev_context *devc = sdi->priv;
+       struct dev_context *devc;
        struct sr_datafeed_packet packet;
-       struct sr_datafeed_analog analog = { 0 };
-       struct sr_probe *probe = teleinfo_find_probe(sdi, probe_name);
+       struct sr_datafeed_analog analog;
+       struct sr_channel *probe;
+
+       devc = sdi->priv;
+       probe = teleinfo_find_probe(sdi, probe_name);
 
        if (!probe || !probe->enabled)
                return;
 
+       memset(&analog, 0, sizeof(struct sr_datafeed_analog));
        analog.probes = g_slist_append(analog.probes, probe);
        analog.num_samples = 1;
        analog.mq = mq;