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

index 7782d48f794b280c1c9bfc0957bb8089b2c521ee..92cf5b3ee4f837065f6175e5072657f577054890 100644 (file)
@@ -128,19 +128,23 @@ SR_PRIV const char *maynuo_m97_mode_to_str(enum maynuo_m97_mode mode)
 static void maynuo_m97_session_send_value(const struct sr_dev_inst *sdi, struct sr_channel *ch, float value, enum sr_mq mq, enum sr_unit unit)
 {
        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;
 
-       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 = 1;
        analog.data = &value;
-       analog.mq = mq;
-       analog.unit = unit;
-       analog.mqflags = SR_MQFLAG_DC;
+       analog.meaning->mq = mq;
+       analog.meaning->unit = unit;
+       analog.meaning->mqflags = SR_MQFLAG_DC;
 
-       packet.type = SR_DF_ANALOG_OLD;
+       packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        sr_session_send(sdi, &packet);
-       g_slist_free(analog.channels);
+       g_slist_free(analog.meaning->channels);
 }
 
 SR_PRIV int maynuo_m97_capture_start(const struct sr_dev_inst *sdi)