mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID:431 - Fix correct interpretation of led states
The LED state bits are not mutually exclusive. Bit [0] says LEDs can be controlled locally and the state bit [1] says wheter the default local settings or the override settings are used. This means that both bits can be set at the same time. Bit [2], the lamp test, indicates wether the test is in progress and logically works the same as [1]. If bit [0] is not set then bit [1] and [2] has no meaning. Signed-off-by: Jens Nyberg <jens.nyberg@ericsson.com>
This commit is contained in:
parent
eb5c73c04e
commit
cacdd1b6ec
@ -1280,49 +1280,53 @@ ipmi_picmg_get_led_state(struct ipmi_intf * intf, int argc, char ** argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
printf("LED states: %x ", rsp->data[1] );
|
printf("LED states: %x ", rsp->data[1] );
|
||||||
if (rsp->data[1] == 0x1)
|
|
||||||
printf("[LOCAL CONTROL]\n");
|
if (!(rsp->data[1] & 0x1)) {
|
||||||
else if (rsp->data[1] == 0x2)
|
printf("[NO LOCAL CONTROL]\n");
|
||||||
printf("[OVERRIDE]\n");
|
return 0;
|
||||||
else if (rsp->data[1] == 0x4)
|
}
|
||||||
printf("[LAMPTEST]\n");
|
|
||||||
else
|
printf("[LOCAL CONTROL");
|
||||||
printf("\n");
|
|
||||||
|
if (rsp->data[1] & 0x2) {
|
||||||
|
printf("|OVERRIDE");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (rsp->data[1] & 0x4) {
|
||||||
|
printf("|LAMPTEST");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("]\n");
|
||||||
|
|
||||||
printf(" Local Control function: %x ", rsp->data[2] );
|
printf(" Local Control function: %x ", rsp->data[2] );
|
||||||
if (rsp->data[2] == 0x0)
|
if (rsp->data[2] == 0x0) {
|
||||||
printf("[OFF]\n");
|
printf("[OFF]\n");
|
||||||
else if (rsp->data[2] == 0xff)
|
} else if (rsp->data[2] == 0xff) {
|
||||||
printf("[ON]\n");
|
printf("[ON]\n");
|
||||||
else
|
} else {
|
||||||
printf("[BLINKING]\n");
|
printf("[BLINKING]\n");
|
||||||
|
}
|
||||||
|
|
||||||
printf(" Local Control On-Duration: %x\n", rsp->data[3] );
|
printf(" Local Control On-Duration: %x\n", rsp->data[3] );
|
||||||
printf(" Local Control Color: %x [%s]\n", rsp->data[4], led_color_str[ rsp->data[4] ]);
|
printf(" Local Control Color: %x [%s]\n", rsp->data[4], led_color_str[ rsp->data[4] ]);
|
||||||
|
|
||||||
/* override state or lamp test */
|
/* override state or lamp test */
|
||||||
if (rsp->data[1] == 0x02) {
|
if (rsp->data[1] & 0x02) {
|
||||||
printf(" Override function: %x ", rsp->data[5] );
|
printf(" Override function: %x ", rsp->data[5] );
|
||||||
if (rsp->data[2] == 0x0)
|
if (rsp->data[2] == 0x0) {
|
||||||
printf("[OFF]\n");
|
printf("[OFF]\n");
|
||||||
else if (rsp->data[2] == 0xff)
|
} else if (rsp->data[2] == 0xff) {
|
||||||
printf("[ON]\n");
|
printf("[ON]\n");
|
||||||
else
|
} else {
|
||||||
printf("[BLINKING]\n");
|
printf("[BLINKING]\n");
|
||||||
|
}
|
||||||
|
|
||||||
printf(" Override On-Duration: %x\n", rsp->data[6] );
|
printf(" Override On-Duration: %x\n", rsp->data[6] );
|
||||||
printf(" Override Color: %x [%s]\n", rsp->data[7], led_color_str[ rsp->data[7] ]);
|
printf(" Override Color: %x [%s]\n", rsp->data[7], led_color_str[ rsp->data[7] ]);
|
||||||
|
|
||||||
}else if (rsp->data[1] == 0x06) {
|
}
|
||||||
printf(" Override function: %x ", rsp->data[5] );
|
|
||||||
if (rsp->data[2] == 0x0)
|
if (rsp->data[1] & 0x04) {
|
||||||
printf("[OFF]\n");
|
|
||||||
else if (rsp->data[2] == 0xff)
|
|
||||||
printf("[ON]\n");
|
|
||||||
else
|
|
||||||
printf("[BLINKING]\n");
|
|
||||||
printf(" Override On-Duration: %x\n", rsp->data[6] );
|
|
||||||
printf(" Override Color: %x [%s]\n", rsp->data[7], led_color_str[ rsp->data[7] ]);
|
|
||||||
printf(" Lamp test duration: %x\n", rsp->data[8] );
|
printf(" Lamp test duration: %x\n", rsp->data[8] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user