28 #ifndef __ONLP_LED_H__ 29 #define __ONLP_LED_H__ 31 #include <onlp/onlp.h> 37 ONLP_LED_CAPS_OFF = (1 << 0),
38 ONLP_LED_CAPS_AUTO = (1 << 1),
39 ONLP_LED_CAPS_AUTO_BLINKING = (1 << 2),
40 ONLP_LED_CAPS_CHAR = (1 << 3),
41 ONLP_LED_CAPS_RED = (1 << 4),
42 ONLP_LED_CAPS_RED_BLINKING = (1 << 5),
43 ONLP_LED_CAPS_ORANGE = (1 << 6),
44 ONLP_LED_CAPS_ORANGE_BLINKING = (1 << 7),
45 ONLP_LED_CAPS_YELLOW = (1 << 8),
46 ONLP_LED_CAPS_YELLOW_BLINKING = (1 << 9),
47 ONLP_LED_CAPS_GREEN = (1 << 10),
48 ONLP_LED_CAPS_GREEN_BLINKING = (1 << 11),
49 ONLP_LED_CAPS_BLUE = (1 << 12),
50 ONLP_LED_CAPS_BLUE_BLINKING = (1 << 13),
51 ONLP_LED_CAPS_PURPLE = (1 << 14),
52 ONLP_LED_CAPS_PURPLE_BLINKING = (1 << 15),
59 ONLP_LED_MODE_AUTO_BLINKING,
62 ONLP_LED_MODE_RED_BLINKING,
64 ONLP_LED_MODE_ORANGE_BLINKING,
66 ONLP_LED_MODE_YELLOW_BLINKING,
68 ONLP_LED_MODE_GREEN_BLINKING,
70 ONLP_LED_MODE_BLUE_BLINKING,
72 ONLP_LED_MODE_PURPLE_BLINKING,
73 ONLP_LED_MODE_LAST = ONLP_LED_MODE_PURPLE_BLINKING,
75 ONLP_LED_MODE_INVALID = -1,
199 #define ONLP_LED_CAPS_VALID(_e) \ 200 (onlp_led_caps_valid((_e))) 208 #define ONLP_LED_MODE_STRINGS \ 237 #define ONLP_LED_MODE_VALID(_e) \ 238 ( (0 <= (_e)) && ((_e) <= ONLP_LED_MODE_PURPLE_BLINKING)) onlp_led_mode_t mode
Definition: led.h:91
onlp_oid_hdr_t hdr
Definition: led.h:85
int onlp_led_hdr_get(onlp_oid_t oid, onlp_oid_hdr_t *rv)
Get the LED header.
int onlp_led_info_to_user_json(onlp_led_info_t *info, cJSON **cj, uint32_t flags)
Convert an LED info structure to user JSON.
const char * onlp_led_caps_desc(onlp_led_caps_t e)
int onlp_led_caps_get(onlp_oid_t oid, uint32_t *caps)
Get the LED caps.
int onlp_led_info_from_json(cJSON *cj, onlp_led_info_t *info)
Convert a JSON object to an LED info structure.
const char * onlp_led_mode_name(onlp_led_mode_t e)
int onlp_led_sw_denit(void)
Deinitialize the led software module.
uint32_t onlp_oid_t
Definition: oids.h:52
const char * onlp_led_caps_name(onlp_led_caps_t e)
int onlp_led_info_get(onlp_oid_t oid, onlp_led_info_t *rv)
Get LED information.
uint32_t caps
Definition: led.h:88
const char * onlp_led_mode_desc(onlp_led_mode_t e)
aim_map_si_t onlp_led_caps_map[]
int onlp_led_char_set(onlp_oid_t oid, char c)
Set the LED char.
onlp_led_caps_e
Definition: led.h:36
aim_map_si_t onlp_led_caps_desc_map[]
int onlp_led_mode_set(onlp_oid_t oid, onlp_led_mode_t mode)
Set the LED mode.
int onlp_led_caps_value(const char *str, onlp_led_caps_t *e, int substr)
aim_map_si_t onlp_led_mode_map[]
char character
Definition: led.h:94
aim_map_si_t onlp_led_mode_desc_map[]
int onlp_led_mode_value(const char *str, onlp_led_mode_t *e, int substr)
enum onlp_led_mode_e onlp_led_mode_t
int onlp_led_caps_valid(onlp_led_caps_t e)
int onlp_led_sw_init(void)
Software initialization of the LED module.
int onlp_led_info_to_json(onlp_led_info_t *info, cJSON **cj, uint32_t flags)
Convert an LED info structure to JSON.
enum onlp_led_caps_e onlp_led_caps_t
struct onlp_led_info_s onlp_led_info_t
onlp_led_mode_e
Definition: led.h:56
int onlp_led_hw_init(uint32_t flags)
Hardware initialization of the LED module.