]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/motech-lps-30x/protocol.c
output/gnuplot: Remove, obsoleted by improved CSV module.
[libsigrok.git] / src / hardware / motech-lps-30x / protocol.c
index 80b799d9e9dd1c08cf0590fa055af97729b957b6..4de6f0e9d4b5fb7546fa85a17c172ffd943b602a 100644 (file)
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-/** @file
- *  <em>Motech LPS-30x series</em> power supply driver
- *  @internal
+/**
+ * @file
+ *
+ * <em>Motech LPS-30x series</em> power supply driver
+ *
+ * @internal
  */
 
 #include <config.h>
@@ -44,6 +47,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;
@@ -51,6 +55,8 @@ static void send_data(struct sr_dev_inst *sdi)
        analog.meaning->mq = SR_MQ_VOLTAGE;
        analog.meaning->unit = SR_UNIT_VOLT;
        analog.meaning->mqflags = SR_MQFLAG_DC;
+       analog.encoding->digits = 3;
+       analog.spec->spec_digits = 2;
        analog.data = data;
 
        for (i = 0; i < devc->model->num_channels; i++)
@@ -60,6 +66,8 @@ static void send_data(struct sr_dev_inst *sdi)
        analog.meaning->mq = SR_MQ_CURRENT;
        analog.meaning->unit = SR_UNIT_AMPERE;
        analog.meaning->mqflags = 0;
+       analog.encoding->digits = 4;
+       analog.spec->spec_digits = 3;
        analog.data = data;
        for (i = 0; i < devc->model->num_channels; i++)
                ((float *)analog.data)[i] = devc->channel_status[i].output_current_last; /* Value always 0 for channel 3, if present! */