]> sigrok.org Git - libsigrok.git/commitdiff
kecheng-kc-330b: Convert to SR_DF_ANALOG.
authorUwe Hermann <redacted>
Sat, 28 May 2016 15:45:44 +0000 (17:45 +0200)
committerUwe Hermann <redacted>
Fri, 17 Jun 2016 13:13:10 +0000 (15:13 +0200)
src/hardware/kecheng-kc-330b/protocol.c
src/hardware/kecheng-kc-330b/protocol.h

index 968ef6968872f86e46b074483d56f122a5a83097..a6ec3ac09ace26999e61029a1a3737bfad1e6444 100644 (file)
@@ -102,18 +102,21 @@ static void send_data(const struct sr_dev_inst *sdi, void *buf, unsigned int buf
 {
        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;
 
        devc = sdi->priv;
 
-       memset(&analog, 0, sizeof(struct sr_datafeed_analog_old));
-       analog.mq = SR_MQ_SOUND_PRESSURE_LEVEL;
-       analog.mqflags = devc->mqflags;
-       analog.unit = SR_UNIT_DECIBEL_SPL;
-       analog.channels = sdi->channels;
+       sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
+       analog.meaning->mq = SR_MQ_SOUND_PRESSURE_LEVEL;
+       analog.meaning->mqflags = devc->mqflags;
+       analog.meaning->unit = SR_UNIT_DECIBEL_SPL;
+       analog.meaning->channels = sdi->channels;
        analog.num_samples = buf_len;
        analog.data = buf;
-       packet.type = SR_DF_ANALOG_OLD;
+       packet.type = SR_DF_ANALOG;
        packet.payload = &analog;
        sr_session_send(sdi, &packet);
 }
index 07597c6ba1dd4fd539cbb82ca7036fc2504b1609..e2090d84dfdc999fa1ffe4d1fa490e7cd099ce00 100644 (file)
@@ -73,7 +73,7 @@ struct dev_context {
        int sample_interval;
        int alarm_low;
        int alarm_high;
-       uint64_t mqflags;
+       enum sr_mqflag mqflags;
        int data_source;
 
        /* Operational state */