X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=hardware%2Fcommon%2Fdmm%2Fmetex14.c;h=c5127252b34bd2d2b5ae34093e5010cc5edaeb1d;hb=2451a20ff5137d178ed4a02ee04076c6eae97235;hp=7d1cc056ed21ac7920c44321247bc71c42771220;hpb=e90cf076aa6854ad3f312179a121bafc4c6e9a22;p=libsigrok.git diff --git a/hardware/common/dmm/metex14.c b/hardware/common/dmm/metex14.c index 7d1cc056..c5127252 100644 --- a/hardware/common/dmm/metex14.c +++ b/hardware/common/dmm/metex14.c @@ -1,5 +1,5 @@ /* - * This file is part of the sigrok project. + * This file is part of the libsigrok project. * * Copyright (C) 2012 Uwe Hermann * @@ -126,6 +126,13 @@ static void parse_flags(const char *buf, struct metex14_info *info) info->is_temperature = !strncmp(buf, "TE", 2); info->is_diode = !strncmp(buf, "DI", 2); info->is_frequency = !strncmp(buf, "FR", 2); + info->is_gain = !strncmp(buf, "DB", 2); + info->is_hfe = !strncmp(buf, "HF", 2); + + /* + * Note: "DB" shows the logarithmic ratio of input voltage to a + * pre-stored (user-changeable) value in the DMM. + */ if (info->is_dc || info->is_ac) info->is_volt = TRUE; @@ -159,6 +166,10 @@ static void parse_flags(const char *buf, struct metex14_info *info) info->is_kilo = info->is_hertz = TRUE; else if (!strncmp(buf + 9, " C", 4)) info->is_celsius = TRUE; + else if (!strncmp(buf + 9, " DB", 4)) + info->is_decibel = TRUE; + else if (!strncmp(buf + 9, " ", 4)) + info->is_unitless = TRUE; /* Byte 13: Always '\r' (carriage return, 0x0d, 13) */ } @@ -207,6 +218,14 @@ static void handle_flags(struct sr_datafeed_analog *analog, float *floatval, analog->mq = SR_MQ_VOLTAGE; analog->unit = SR_UNIT_VOLT; } + if (info->is_gain) { + analog->mq = SR_MQ_GAIN; + analog->unit = SR_UNIT_DECIBEL_VOLT; + } + if (info->is_hfe) { + analog->mq = SR_MQ_GAIN; + analog->unit = SR_UNIT_UNITLESS; + } /* Measurement related flags */ if (info->is_ac)