]> sigrok.org Git - libsigrok.git/blobdiff - src/scale/kern.c
ut372: properly set encoding digits
[libsigrok.git] / src / scale / kern.c
index 9784c95219b47c34aabe56c0c6b20c9dcddc4399..55e02ad4419aadfdff29bfe168b5178a3047930f 100644 (file)
@@ -22,6 +22,7 @@
  * KERN scale protocol parser.
  */
 
+#include <config.h>
 #include <string.h>
 #include <ctype.h>
 #include <math.h>
@@ -115,37 +116,37 @@ static void handle_flags(struct sr_datafeed_analog *analog, float *floatval,
        (void)floatval;
 
        /* Measured quantity: mass. */
-       analog->mq = SR_MQ_MASS;
+       analog->meaning->mq = SR_MQ_MASS;
 
        /* Unit */
        if (info->is_gram)
-               analog->unit = SR_UNIT_GRAM;
+               analog->meaning->unit = SR_UNIT_GRAM;
        if (info->is_carat)
-               analog->unit = SR_UNIT_CARAT;
+               analog->meaning->unit = SR_UNIT_CARAT;
        if (info->is_ounce)
-               analog->unit = SR_UNIT_OUNCE;
+               analog->meaning->unit = SR_UNIT_OUNCE;
        if (info->is_pound)
-               analog->unit = SR_UNIT_POUND;
+               analog->meaning->unit = SR_UNIT_POUND;
        if (info->is_troy_ounce)
-               analog->unit = SR_UNIT_TROY_OUNCE;
+               analog->meaning->unit = SR_UNIT_TROY_OUNCE;
        if (info->is_pennyweight)
-               analog->unit = SR_UNIT_PENNYWEIGHT;
+               analog->meaning->unit = SR_UNIT_PENNYWEIGHT;
        if (info->is_grain)
-               analog->unit = SR_UNIT_GRAIN;
+               analog->meaning->unit = SR_UNIT_GRAIN;
        if (info->is_tael)
-               analog->unit = SR_UNIT_TAEL;
+               analog->meaning->unit = SR_UNIT_TAEL;
        if (info->is_momme)
-               analog->unit = SR_UNIT_MOMME;
+               analog->meaning->unit = SR_UNIT_MOMME;
        if (info->is_tola)
-               analog->unit = SR_UNIT_TOLA;
+               analog->meaning->unit = SR_UNIT_TOLA;
        if (info->is_percentage)
-               analog->unit = SR_UNIT_PERCENTAGE;
+               analog->meaning->unit = SR_UNIT_PERCENTAGE;
        if (info->is_piece)
-               analog->unit = SR_UNIT_PIECE;
+               analog->meaning->unit = SR_UNIT_PIECE;
 
        /* Measurement related flags */
        if (info->is_unstable)
-               analog->mqflags |= SR_MQFLAG_UNSTABLE;
+               analog->meaning->mqflags |= SR_MQFLAG_UNSTABLE;
 }
 
 SR_PRIV gboolean sr_kern_packet_valid(const uint8_t *buf)