From: Uwe Hermann Date: Sat, 28 May 2016 15:46:17 +0000 (+0200) Subject: maynuo-m97: Convert to SR_DF_ANALOG. X-Git-Tag: libsigrok-0.5.0~320 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=94885d200d228494aafafeaa30fdce6eb42bfc8b;p=libsigrok.git maynuo-m97: Convert to SR_DF_ANALOG. --- diff --git a/src/hardware/maynuo-m97/protocol.c b/src/hardware/maynuo-m97/protocol.c index 7782d48f..92cf5b3e 100644 --- a/src/hardware/maynuo-m97/protocol.c +++ b/src/hardware/maynuo-m97/protocol.c @@ -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)