]> sigrok.org Git - libsigrok.git/commitdiff
yokogawa-dlm: Convert to SR_DF_ANALOG.
authorUwe Hermann <redacted>
Sat, 28 May 2016 15:47:45 +0000 (17:47 +0200)
committerUwe Hermann <redacted>
Fri, 17 Jun 2016 13:13:11 +0000 (15:13 +0200)
src/hardware/yokogawa-dlm/protocol.c

index 7d6c7e9452acb749302f8b5c0f26b35cf91519c9..f3d38f8c5f42eafb8e70a395aa93a9e490cf24eb 100644 (file)
@@ -964,7 +964,10 @@ static int dlm_analog_samples_send(GArray *data,
        struct dev_context *devc;
        struct scope_state *model_state;
        struct sr_channel *ch;
-       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 sr_datafeed_packet packet;
 
        devc = sdi->priv;
@@ -992,16 +995,17 @@ static int dlm_analog_samples_send(GArray *data,
                g_array_append_val(float_data, voltage);
        }
 
-       analog.channels = g_slist_append(NULL, ch);
+       sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+       analog.meaning->channels = g_slist_append(NULL, ch);
        analog.num_samples = float_data->len;
        analog.data = (float*)float_data->data;
-       analog.mq = SR_MQ_VOLTAGE;
-       analog.unit = SR_UNIT_VOLT;
-       analog.mqflags = 0;
-       packet.type = SR_DF_ANALOG_OLD;
+       analog.meaning->mq = SR_MQ_VOLTAGE;
+       analog.meaning->unit = SR_UNIT_VOLT;
+       analog.meaning->mqflags = 0;
+       packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        sr_session_send(sdi, &packet);
-       g_slist_free(analog.channels);
+       g_slist_free(analog.meaning->channels);
 
        g_array_free(float_data, TRUE);
        g_array_remove_range(data, 0, samples * sizeof(uint8_t));