Locator LED cannot be set to ON.
debug_log (VXOS_TRACE_DEBUG, "START on_off=%d\n", on_off);
led = get_current_pdb()->onlp_loc_led;
if (led == 0)
{
debug_log (VXOS_TRACE_ERROR, "LOCATOR LED is NOT defined in CDB\n");
rc = -50;
} else
{
cid = ONLP_LED_ID_CREATE(led);
rc = onlp_led_info_get(cid, &led_info);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d onlp_led_info_get rc=%d\n", led, cid, rc);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d description='%s'\n", led, cid, led_info.hdr.description);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d caps=%d 0x%08X\n", led, cid, led_info.caps, led_info.caps);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d mode=%d\n", led, cid, led_info.mode);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d status=%d\n", led, cid, led_info.status);
if ((led_info.caps & ONLP_LED_CAPS_ON_OFF) == 0)
{
debug_log (VXOS_TRACE_ERROR, "LOCATOR LED does not have ON_OFF capacity\n");
rc = -50;
} else
{
if ((led_info.caps & COTS_LED_BLINKS) == 0)
{
get_current_pdb()->onlp_loc_led_cap_blinking = FALSE;
if (on_off)
{
if ((led_info.caps & ONLP_LED_CAPS_RED) != 0)
set_mode = ONLP_LED_MODE_RED;
else if ((led_info.caps & ONLP_LED_CAPS_ORANGE) != 0)
set_mode = ONLP_LED_MODE_ORANGE;
else if ((led_info.caps & ONLP_LED_CAPS_YELLOW) != 0)
set_mode = ONLP_LED_MODE_YELLOW;
else if ((led_info.caps & ONLP_LED_CAPS_GREEN) != 0)
set_mode = ONLP_LED_MODE_GREEN;
else if ((led_info.caps & ONLP_LED_CAPS_BLUE) != 0)
set_mode = ONLP_LED_MODE_BLUE;
else if ((led_info.caps & ONLP_LED_CAPS_PURPLE) != 0)
set_mode = ONLP_LED_MODE_PURPLE;
else if ((led_info.caps & ONLP_LED_CAPS_AUTO) != 0)
set_mode = ONLP_LED_MODE_AUTO;
}
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d caps=0x%08X on_off=%d set_mode=%d\n",
led, cid, led_info.caps, on_off, set_mode);
rc = onlp_led_mode_set(cid, set_mode);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d onlp_led_mode_set %d rc=%d\n",
led, cid, set_mode, rc);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d caps=0x%08X on_off=%d\n",
led, cid, led_info.caps, on_off);
rc = onlp_led_set(cid, on_off);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d onlp_led_set on_off=%d rc=%d\n",
led, cid, on_off, rc);
} else
{
get_current_pdb()->onlp_loc_led_cap_blinking = TRUE;
if (on_off)
{
if ((led_info.caps & ONLP_LED_CAPS_RED_BLINKING) != 0)
set_mode = ONLP_LED_MODE_RED_BLINKING;
else if ((led_info.caps & ONLP_LED_CAPS_ORANGE_BLINKING) != 0)
set_mode = ONLP_LED_MODE_ORANGE_BLINKING;
else if ((led_info.caps & ONLP_LED_CAPS_YELLOW_BLINKING) != 0)
set_mode = ONLP_LED_MODE_YELLOW_BLINKING;
else if ((led_info.caps & ONLP_LED_CAPS_GREEN_BLINKING) != 0)
set_mode = ONLP_LED_MODE_GREEN_BLINKING;
else if ((led_info.caps & ONLP_LED_CAPS_BLUE_BLINKING) != 0)
set_mode = ONLP_LED_MODE_BLUE_BLINKING;
else if ((led_info.caps & ONLP_LED_CAPS_PURPLE_BLINKING) != 0)
set_mode = ONLP_LED_MODE_PURPLE_BLINKING;
else if ((led_info.caps & ONLP_LED_CAPS_AUTO_BLINKING) != 0)
set_mode = ONLP_LED_MODE_AUTO_BLINKING;
}
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d caps=0x%08X on_off=%d set_mode=%d\n",
led, cid, led_info.caps, on_off, set_mode);
rc = onlp_led_mode_set(cid, set_mode);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d onlp_led_mode_set %d rc=%d\n",
led, cid, set_mode, rc);
}
}
rc = onlp_led_info_get(cid, &led_info);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d onlp_led_info_get rc=%d\n", led, cid, rc);
debug_log (VXOS_TRACE_DEBUG, "LED %d cid=%d status=%d\n", led, cid, led_info.status);
}
debug_log (VXOS_TRACE_DEBUG, "DONE on_off=%d rc=%d\n", on_off, rc);
return (rc);
Library function onlp_led_set() with second parameter set to 1 returns -10 (ONLP_STATUS_E_UNSUPPORTED). Although LED capacities ( caps=0x00001001) indicates that it has ON_OFF and ORANGE capacity.
The same code on AS7312-54XS with library libonlp-x86-64-accton-as7312-54x.so works well
Trace:
Library function onlp_led_set() with second parameter set to 1 returns 0 (ONLP_STATUS_OK).
LED capacities ( caps=0x00001001) are the same as on AS7726-56X: ON_OFF and ORANGE capacity.
Function is called on timer every second tomake LED blinking. It blinks orange on this platform.