Support Power Supply derating sensor
Change-Id: I893d09a4ecb88507386e8b89015c4b53b18951c3
Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index ea0eac4..4562476 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -45,9 +45,9 @@
{0xC7, 0x03, "SYSTEM"},
{0xC7, 0x03, "MAIN_PLANAR"},
{0xC2, 0x6F, "PowerCap"},
- {0xD8, 0x03, "PowerSupplyRedundancy"},
+ {0x0b, 0xCA, "PowerSupplyRedundancy"},
{0xDA, 0x03, "TurboAllowed"},
- {0xB4, 0x6F, "PowerSupplyDerating"},
+ {0xD8, 0xC8, "PowerSupplyDerating"},
{0xFF, 0x00, ""},
};
@@ -308,16 +308,14 @@
sensorTypemap_t *s = g_SensorTypeMap;
char r=0;
-
while (s->number != 0xFF) {
if (!strcmp(s->dbusname,p)) {
- r = s->number;
+ r = s->typecode;
break;
}
s++;
}
-
if (s->number == 0xFF)
printf("Failed to find Sensor Type %s\n", p);
@@ -501,6 +499,7 @@
switch(type) {
case 0xC3:
case 0xC2:
+ case 0xC8:
r = sd_bus_get_property(bus,a.bus, a.path, a.interface, "value", NULL, &reply, "i");
if (r < 0) {
fprintf(stderr, "Failed to call sd_bus_get_property:%d, %s\n", r, strerror(-r));