]> sigrok.org Git - libsigrok.git/commitdiff
agilent-dmm: Convert to SR_DF_ANALOG.
authorUwe Hermann <redacted>
Sat, 14 May 2016 15:14:53 +0000 (17:14 +0200)
committerUwe Hermann <redacted>
Thu, 16 Jun 2016 13:05:02 +0000 (15:05 +0200)
src/hardware/agilent-dmm/api.c
src/hardware/agilent-dmm/sched.c

index 47e38fb28ee50a60d375a07c4dc1e2cf090a2399..27da6b93d118267c8ed4a1aad710f7d3b0a5b4a3 100644 (file)
@@ -130,7 +130,7 @@ static GSList *scan(struct sr_dev_driver *di, GSList *options)
                        devc = g_malloc0(sizeof(struct dev_context));
                        sr_sw_limits_init(&devc->limits);
                        devc->profile = &supported_agdmm[i];
-                       devc->cur_mq = -1;
+                       devc->cur_mq = 0;
                        sdi->inst_type = SR_INST_SERIAL;
                        sdi->conn = serial;
                        sdi->priv = devc;
index c3dab0b7561c1d591a1d25e00382c6b767c535a5..0dd1c71d9d7a7607e704ad6ef15b0a75294e50f9 100644 (file)
@@ -264,7 +264,10 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match)
 {
        struct dev_context *devc;
        struct sr_datafeed_packet packet;
-       struct sr_datafeed_analog_old analog;
+       struct sr_datafeed_analog analog;
+       struct sr_analog_encoding encoding;
+       struct sr_analog_meaning meaning;
+       struct sr_analog_spec spec;
        float fvalue;
        const char *s;
        char *mstr;
@@ -296,14 +299,14 @@ static int recv_fetc(const struct sr_dev_inst *sdi, GMatchInfo *match)
                        fvalue /= devc->cur_divider;
        }
 
-       memset(&analog, 0, sizeof(struct sr_datafeed_analog_old));
-       analog.mq = devc->cur_mq;
-       analog.unit = devc->cur_unit;
-       analog.mqflags = devc->cur_mqflags;
-       analog.channels = sdi->channels;
+       sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+       analog.meaning->mq = devc->cur_mq;
+       analog.meaning->unit = devc->cur_unit;
+       analog.meaning->mqflags = devc->cur_mqflags;
+       analog.meaning->channels = sdi->channels;
        analog.num_samples = 1;
        analog.data = &fvalue;
-       packet.type = SR_DF_ANALOG_OLD;
+       packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        sr_session_send(sdi, &packet);