add energy meter device type and related units

This commit is contained in:
Aurelien Jacobs 2013-10-10 22:28:35 +02:00 committed by Bert Vermeulen
parent c02dc3e261
commit 45315d0460
2 changed files with 14 additions and 0 deletions

View 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 -------------------------------------------*/
/**

View 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, "");