From: Alexandru Gagniuc Date: Mon, 4 Apr 2016 01:04:42 +0000 (-0700) Subject: analog: Add MQ Flag for four-wire measurements X-Git-Tag: libsigrok-0.5.0~493 X-Git-Url: http://sigrok.org/gitweb/?a=commitdiff_plain;h=6d5cd3bd383b293f16d4db0c91c366d939e4851b;p=libsigrok.git analog: Add MQ Flag for four-wire measurements On the high-end bench multimeters, resistance can be measured with a kelvin connection as well as the more common two wire method. Provide a flag which can indicate if four-wire mode is used. --- diff --git a/include/libsigrok/libsigrok.h b/include/libsigrok/libsigrok.h index 31ee5dce..6096b5bf 100644 --- a/include/libsigrok/libsigrok.h +++ b/include/libsigrok/libsigrok.h @@ -383,6 +383,8 @@ enum sr_mqflag { SR_MQFLAG_REFERENCE = 0x80000, /** Unstable value (hasn't settled yet). */ SR_MQFLAG_UNSTABLE = 0x100000, + /** Measurement is four wire (e.g. Kelvin connection). */ + SR_MQFLAG_FOUR_WIRE = 0x200000, /* * Update mq_strings[] (analog.c) and fancyprint() (output/analog.c) diff --git a/src/analog.c b/src/analog.c index 892cc6ec..da1560cd 100644 --- a/src/analog.c +++ b/src/analog.c @@ -114,6 +114,7 @@ static struct unit_mq_string mq_strings[] = { { SR_MQFLAG_AVG, " AVG" }, { SR_MQFLAG_REFERENCE, " REF" }, { SR_MQFLAG_UNSTABLE, " UNSTABLE" }, + { SR_MQFLAG_FOUR_WIRE, " 4-WIRE" }, ALL_ZERO }; diff --git a/src/output/analog.c b/src/output/analog.c index 5e6e4aca..72d1eb87 100644 --- a/src/output/analog.c +++ b/src/output/analog.c @@ -273,6 +273,8 @@ static void fancyprint(int unit, int mqflags, float value, GString *out) g_string_append_printf(out, " REF"); if (mqflags & SR_MQFLAG_UNSTABLE) g_string_append_printf(out, " UNSTABLE"); + if (mqflags & SR_MQFLAG_FOUR_WIRE) + g_string_append_printf(out, " 4-WIRE"); g_string_append_c(out, '\n'); }