]> sigrok.org Git - libsigrok.git/blobdiff - src/dmm/metex14.c
dmm: Convert to SR_DF_ANALOG.
[libsigrok.git] / src / dmm / metex14.c
index b39c9324c21b12f566d82cf5f7356ecd3e8a34db..a6e2a317369170ecfd7a912bc9122f453e42bf68 100644 (file)
@@ -170,7 +170,7 @@ static void parse_flags(const char *buf, struct metex14_info *info)
        /* Byte 13: Always '\r' (carriage return, 0x0d, 13) */
 }
 
-static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval,
+static void handle_flags(struct sr_datafeed_analog *analog, float *floatval,
                         const struct metex14_info *info)
 {
        /* Factors */
@@ -189,53 +189,53 @@ static void handle_flags(struct sr_datafeed_analog_old *analog, float *floatval,
 
        /* Measurement modes */
        if (info->is_volt) {
-               analog->mq = SR_MQ_VOLTAGE;
-               analog->unit = SR_UNIT_VOLT;
+               analog->meaning->mq = SR_MQ_VOLTAGE;
+               analog->meaning->unit = SR_UNIT_VOLT;
        }
        if (info->is_ampere) {
-               analog->mq = SR_MQ_CURRENT;
-               analog->unit = SR_UNIT_AMPERE;
+               analog->meaning->mq = SR_MQ_CURRENT;
+               analog->meaning->unit = SR_UNIT_AMPERE;
        }
        if (info->is_ohm) {
-               analog->mq = SR_MQ_RESISTANCE;
-               analog->unit = SR_UNIT_OHM;
+               analog->meaning->mq = SR_MQ_RESISTANCE;
+               analog->meaning->unit = SR_UNIT_OHM;
        }
        if (info->is_hertz) {
-               analog->mq = SR_MQ_FREQUENCY;
-               analog->unit = SR_UNIT_HERTZ;
+               analog->meaning->mq = SR_MQ_FREQUENCY;
+               analog->meaning->unit = SR_UNIT_HERTZ;
        }
        if (info->is_farad) {
-               analog->mq = SR_MQ_CAPACITANCE;
-               analog->unit = SR_UNIT_FARAD;
+               analog->meaning->mq = SR_MQ_CAPACITANCE;
+               analog->meaning->unit = SR_UNIT_FARAD;
        }
        if (info->is_celsius) {
-               analog->mq = SR_MQ_TEMPERATURE;
-               analog->unit = SR_UNIT_CELSIUS;
+               analog->meaning->mq = SR_MQ_TEMPERATURE;
+               analog->meaning->unit = SR_UNIT_CELSIUS;
        }
        if (info->is_diode) {
-               analog->mq = SR_MQ_VOLTAGE;
-               analog->unit = SR_UNIT_VOLT;
+               analog->meaning->mq = SR_MQ_VOLTAGE;
+               analog->meaning->unit = SR_UNIT_VOLT;
        }
        if (info->is_gain) {
-               analog->mq = SR_MQ_GAIN;
-               analog->unit = SR_UNIT_DECIBEL_VOLT;
+               analog->meaning->mq = SR_MQ_GAIN;
+               analog->meaning->unit = SR_UNIT_DECIBEL_VOLT;
        }
        if (info->is_hfe) {
-               analog->mq = SR_MQ_GAIN;
-               analog->unit = SR_UNIT_UNITLESS;
+               analog->meaning->mq = SR_MQ_GAIN;
+               analog->meaning->unit = SR_UNIT_UNITLESS;
        }
        if (info->is_logic) {
-               analog->mq = SR_MQ_GAIN;
-               analog->unit = SR_UNIT_UNITLESS;
+               analog->meaning->mq = SR_MQ_GAIN;
+               analog->meaning->unit = SR_UNIT_UNITLESS;
        }
 
        /* Measurement related flags */
        if (info->is_ac)
-               analog->mqflags |= SR_MQFLAG_AC;
+               analog->meaning->mqflags |= SR_MQFLAG_AC;
        if (info->is_dc)
-               analog->mqflags |= SR_MQFLAG_DC;
+               analog->meaning->mqflags |= SR_MQFLAG_DC;
        if (info->is_diode)
-               analog->mqflags |= SR_MQFLAG_DIODE;
+               analog->meaning->mqflags |= SR_MQFLAG_DIODE;
 }
 
 static gboolean flags_valid(const struct metex14_info *info)
@@ -311,7 +311,7 @@ SR_PRIV gboolean sr_metex14_packet_valid(const uint8_t *buf)
  * @param buf Buffer containing the protocol packet. Must not be NULL.
  * @param floatval Pointer to a float variable. That variable will be modified
  *                 in-place depending on the protocol packet. Must not be NULL.
- * @param analog Pointer to a struct sr_datafeed_analog_old. The struct will be
+ * @param analog Pointer to a struct sr_datafeed_analog. The struct will be
  *               filled with data according to the protocol packet.
  *               Must not be NULL.
  * @param info Pointer to a struct metex14_info. The struct will be filled
@@ -321,7 +321,7 @@ SR_PRIV gboolean sr_metex14_packet_valid(const uint8_t *buf)
  *         'analog' variable contents are undefined and should not be used.
  */
 SR_PRIV int sr_metex14_parse(const uint8_t *buf, float *floatval,
-                            struct sr_datafeed_analog_old *analog, void *info)
+                            struct sr_datafeed_analog *analog, void *info)
 {
        int ret;
        struct metex14_info *info_local;