]> sigrok.org Git - libsigrok.git/commitdiff
add energy meter device type and related units
authorAurelien Jacobs <redacted>
Thu, 10 Oct 2013 20:28:35 +0000 (22:28 +0200)
committerBert Vermeulen <redacted>
Thu, 24 Oct 2013 14:41:11 +0000 (15:41 +0100)
libsigrok.h
output/analog.c

index 67f3197159bcd12129bdfc1903a4887bb9c0a7be..17d7fc17d7a5249dff9d11c585ec95891bb596d9 100644 (file)
@@ -217,6 +217,9 @@ enum {
         */
        SR_UNIT_CONCENTRATION,
        SR_UNIT_REVOLUTIONS_PER_MINUTE,
+       SR_UNIT_VOLT_AMPERE,
+       SR_UNIT_WATT,
+       SR_UNIT_WATT_HOUR,
 };
 
 /** Values for sr_datafeed_analog.flags. */
@@ -583,6 +586,9 @@ enum {
        /** The device can measure humidity. */
        SR_CONF_HYGROMETER,
 
+       /** The device can measure energy consumption. */
+       SR_CONF_ENERGYMETER,
+
        /*--- Driver scan options -------------------------------------------*/
 
        /**
index 7437663924f86d1688fc190f134fe2fa9aee7e80..50189b41334924ed45673ac76baea3c1a7b703fd 100644 (file)
@@ -175,6 +175,14 @@ static void fancyprint(int unit, int mqflags, float value, GString *out)
                break;
        case SR_UNIT_REVOLUTIONS_PER_MINUTE:
                si_printf(value, out, "RPM");
+       case SR_UNIT_VOLT_AMPERE:
+               si_printf(value, out, "VA");
+               break;
+       case SR_UNIT_WATT:
+               si_printf(value, out, "W");
+               break;
+       case SR_UNIT_WATT_HOUR:
+               si_printf(value, out, "Wh");
                break;
        default:
                si_printf(value, out, "");