X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fscpi-pps%2Fprotocol.c;h=825fdb945257a32b62eaadc36f8f7d57fee1534b;hb=deb7615262ac4f9cc0750a08351afa7cbf9c34d5;hp=b6e60b9622e24e55f13d5411d91594836db75e91;hpb=f2bbcc330a6bcb65500b298bec8c40974ed246d4;p=libsigrok.git diff --git a/src/hardware/scpi-pps/protocol.c b/src/hardware/scpi-pps/protocol.c index b6e60b96..825fdb94 100644 --- a/src/hardware/scpi-pps/protocol.c +++ b/src/hardware/scpi-pps/protocol.c @@ -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. */ @@ -118,6 +124,10 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data) analog.meaning->unit = SR_UNIT_WATT; analog.encoding->digits = ch_spec->power[4]; analog.spec->spec_digits = ch_spec->power[3]; + } else if (pch->mq == SR_MQ_FREQUENCY) { + analog.meaning->unit = SR_UNIT_HERTZ; + analog.encoding->digits = ch_spec->frequency[4]; + analog.spec->spec_digits = ch_spec->frequency[3]; } f = (float)g_variant_get_double(gvdata); g_variant_unref(gvdata);