]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/scpi-pps/protocol.c
scpi-pps: Data capture dynamically-probed channels
[libsigrok.git] / src / hardware / scpi-pps / protocol.c
index 9609936a23ae0604df899b9ddc23482c12111715..825fdb945257a32b62eaadc36f8f7d57fee1534b 100644 (file)
@@ -97,7 +97,13 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data)
        if (ret != SR_OK)
                return ret;
 
-       ch_spec = &devc->device->channels[pch->hw_output_idx];
+       if (devc->channels) {
+               /* Dynamically-probed devices. */
+               ch_spec = &devc->channels[pch->hw_output_idx];
+       } else {
+               /* Statically-configured devices. */
+               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. */