]> sigrok.org Git - libsigrok.git/commitdiff
session_driver.c: Convert to SR_DF_ANALOG.
authorUwe Hermann <redacted>
Sat, 28 May 2016 16:01:10 +0000 (18:01 +0200)
committerUwe Hermann <redacted>
Fri, 17 Jun 2016 13:13:12 +0000 (15:13 +0200)
src/session_driver.c

index 3aabffa2ecbd59cb11596386a7c44b2404ae3852..99d1c6cf3473e6362b3da6b2cd8b10fda48e23a6 100644 (file)
@@ -66,7 +66,10 @@ static gboolean stream_session_data(struct sr_dev_inst *sdi)
        struct session_vdev *vdev;
        struct sr_datafeed_packet packet;
        struct sr_datafeed_logic logic;
-       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;
        struct zip_stat zs;
        int ret, got_data;
        char capturefile[16];
@@ -137,15 +140,16 @@ static gboolean stream_session_data(struct sr_dev_inst *sdi)
        if (ret > 0) {
                got_data = TRUE;
                if (vdev->cur_analog_channel != 0) {
-                       packet.type = SR_DF_ANALOG_OLD;
+                       packet.type = SR_DF_ANALOG;
                        packet.payload = &analog;
-                       analog.channels = g_slist_prepend(NULL,
+                       sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+                       analog.meaning->channels = g_slist_prepend(NULL,
                                        g_array_index(vdev->analog_channels,
                                                struct sr_channel *, vdev->cur_analog_channel - 1));
                        analog.num_samples = ret / sizeof(float);
-                       analog.mq = SR_MQ_VOLTAGE;
-                       analog.unit = SR_UNIT_VOLT;
-                       analog.mqflags = SR_MQFLAG_DC;
+                       analog.meaning->mq = SR_MQ_VOLTAGE;
+                       analog.meaning->unit = SR_UNIT_VOLT;
+                       analog.meaning->mqflags = SR_MQFLAG_DC;
                        analog.data = (float *) buf;
                } else {
                        if (ret % vdev->unitsize != 0)