From: Uwe Hermann Date: Sun, 28 Aug 2016 21:50:33 +0000 (+0200) Subject: Document if or why sometimes digits/spec_digits is 0. X-Git-Tag: libsigrok-0.5.0~234 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=869c83751149aa03cda072355c2b670569cdfc0d;p=libsigrok.git Document if or why sometimes digits/spec_digits is 0. --- diff --git a/src/hardware/atten-pps3xxx/protocol.c b/src/hardware/atten-pps3xxx/protocol.c index 0102adbd..7cf0f934 100644 --- a/src/hardware/atten-pps3xxx/protocol.c +++ b/src/hardware/atten-pps3xxx/protocol.c @@ -47,6 +47,7 @@ static void handle_packet(const struct sr_dev_inst *sdi) devc = sdi->priv; dump_packet("received", devc->packet); + /* Note: digits/spec_digits will be overridden later. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); packet.type = SR_DF_ANALOG; diff --git a/src/hardware/brymen-bm86x/protocol.c b/src/hardware/brymen-bm86x/protocol.c index adf0e0f6..f6ccc306 100644 --- a/src/hardware/brymen-bm86x/protocol.c +++ b/src/hardware/brymen-bm86x/protocol.c @@ -218,6 +218,7 @@ static void brymen_bm86x_handle_packet(const struct sr_dev_inst *sdi, devc = sdi->priv; + /* Note: digits/spec_digits will be overridden later. */ sr_analog_init(&analog[0], &encoding[0], &meaning[0], &spec[0], 0); sr_analog_init(&analog[1], &encoding[1], &meaning[1], &spec[1], 0); diff --git a/src/hardware/center-3xx/protocol.c b/src/hardware/center-3xx/protocol.c index fba88f64..b4d9ed5b 100644 --- a/src/hardware/center-3xx/protocol.c +++ b/src/hardware/center-3xx/protocol.c @@ -139,6 +139,7 @@ static int handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, int idx) devc = sdi->priv; + /* Note: digits/spec_digits will be overridden later. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); memset(&info, 0, sizeof(struct center_info)); diff --git a/src/hardware/kern-scale/protocol.c b/src/hardware/kern-scale/protocol.c index 01838e3d..354f1e84 100644 --- a/src/hardware/kern-scale/protocol.c +++ b/src/hardware/kern-scale/protocol.c @@ -43,6 +43,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, devc = sdi->priv; + /* Note: digits/spec_digits will be overridden later. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); analog.meaning->channels = sdi->channels; diff --git a/src/hardware/korad-kaxxxxp/protocol.c b/src/hardware/korad-kaxxxxp/protocol.c index e22ec341..4705403f 100644 --- a/src/hardware/korad-kaxxxxp/protocol.c +++ b/src/hardware/korad-kaxxxxp/protocol.c @@ -348,6 +348,7 @@ SR_PRIV int korad_kaxxxxp_receive_data(int fd, int revents, void *cb_data) /* Get the value. */ korad_kaxxxxp_get_reply(serial, devc); + /* Note: digits/spec_digits will be overridden later. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); /* Send the value forward. */ diff --git a/src/hardware/lascar-el-usb/protocol.c b/src/hardware/lascar-el-usb/protocol.c index 96beb5a1..fc24fbe7 100644 --- a/src/hardware/lascar-el-usb/protocol.c +++ b/src/hardware/lascar-el-usb/protocol.c @@ -398,6 +398,7 @@ static void lascar_el_usb_dispatch(struct sr_dev_inst *sdi, unsigned char *buf, devc = sdi->priv; + /* Note: digits/spec_digits will be overridden later. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); samples = buflen / devc->sample_size; diff --git a/src/hardware/motech-lps-30x/protocol.c b/src/hardware/motech-lps-30x/protocol.c index beb2bcde..0681eed6 100644 --- a/src/hardware/motech-lps-30x/protocol.c +++ b/src/hardware/motech-lps-30x/protocol.c @@ -44,6 +44,7 @@ static void send_data(struct sr_dev_inst *sdi) 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 = sdi->channels; diff --git a/src/hardware/scpi-pps/protocol.c b/src/hardware/scpi-pps/protocol.c index 1cd15759..4c7a649c 100644 --- a/src/hardware/scpi-pps/protocol.c +++ b/src/hardware/scpi-pps/protocol.c @@ -87,6 +87,7 @@ SR_PRIV int scpi_pps_receive_data(int fd, int revents, void *cb_data) 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; diff --git a/src/hardware/serial-dmm/protocol.c b/src/hardware/serial-dmm/protocol.c index 9c626a8a..1d1ca482 100644 --- a/src/hardware/serial-dmm/protocol.c +++ b/src/hardware/serial-dmm/protocol.c @@ -55,6 +55,7 @@ static void handle_packet(const uint8_t *buf, struct sr_dev_inst *sdi, log_dmm_packet(buf); devc = sdi->priv; + /* Note: digits/spec_digits will be overridden by the DMM parsers. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); analog.meaning->channels = sdi->channels; diff --git a/src/hardware/teleinfo/protocol.c b/src/hardware/teleinfo/protocol.c index 54be6252..88fbfac3 100644 --- a/src/hardware/teleinfo/protocol.c +++ b/src/hardware/teleinfo/protocol.c @@ -70,6 +70,7 @@ static void teleinfo_send_value(struct sr_dev_inst *sdi, const char *channel_nam if (!ch || !ch->enabled) return; + /* Note: digits/spec_digits is actually really 0 for this device! */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); analog.meaning->channels = g_slist_append(analog.meaning->channels, ch); analog.num_samples = 1; diff --git a/src/hardware/uni-t-dmm/protocol.c b/src/hardware/uni-t-dmm/protocol.c index 15cdb0c2..79dcc747 100644 --- a/src/hardware/uni-t-dmm/protocol.c +++ b/src/hardware/uni-t-dmm/protocol.c @@ -67,6 +67,7 @@ static void decode_packet(struct sr_dev_inst *sdi, const uint8_t *buf) devc = sdi->priv; dmm = (struct dmm_info *)sdi->driver; + /* Note: digits/spec_digits will be overridden by the DMM parsers. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); info = g_malloc(dmm->info_size); diff --git a/src/lcr/es51919.c b/src/lcr/es51919.c index d093770e..cd901366 100644 --- a/src/lcr/es51919.c +++ b/src/lcr/es51919.c @@ -644,6 +644,7 @@ static void handle_packet(struct sr_dev_inst *sdi, const uint8_t *pkt) frame = FALSE; + /* Note: digits/spec_digits will be overridden later. */ sr_analog_init(&analog, &encoding, &meaning, &spec, 0); analog.num_samples = 1;