]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/scpi-pps/protocol.c
drivers: Use ARRAY_AND_SIZE where possible.
[libsigrok.git] / src / hardware / scpi-pps / protocol.c
index 1cd157598e2461331515685d394bf55266d22a87..5afaa5e9743d20fc87f108a6d6eee25d28fc9ccf 100644 (file)
@@ -67,7 +67,7 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data)
        struct sr_scpi_dev_inst *scpi;
        struct pps_channel *pch;
        const struct channel_spec *ch_spec;
-       float f;
+       double d;
        int cmd;
 
        (void)fd;
@@ -82,11 +82,12 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data)
        scpi = sdi->conn;
 
        /* Retrieve requested value for this state. */
-       if (sr_scpi_get_float(scpi, NULL, &f) == SR_OK) {
+       if (sr_scpi_get_double(scpi, NULL, &d) == SR_OK) {
                pch = devc->cur_channel->priv;
                ch_spec = &devc->device->channels[pch->hw_output_idx];
                packet.type = SR_DF_ANALOG;
                packet.payload = &analog;
+               /* Note: digits/spec_digits will be overridden later. */
                sr_analog_init(&analog, &encoding, &meaning, &spec, 0);
                analog.meaning->channels = g_slist_append(NULL, devc->cur_channel);
                analog.num_samples = 1;
@@ -105,7 +106,7 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data)
                        analog.spec->spec_digits = ch_spec->power[3];
                }
                analog.meaning->mqflags = SR_MQFLAG_DC;
-               analog.data = &f;
+               analog.data = &d;
                sr_session_send(sdi, &packet);
                g_slist_free(analog.meaning->channels);
        }