ONLP
Open Network Linux Platform APIs
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables

Data Structures

struct  onlp_led_info_s
 

Macros

#define ONLP_LED_CAPS_VALID(_e)   (onlp_led_caps_valid((_e)))
 
#define ONLP_LED_MODE_STRINGS
 
#define ONLP_LED_MODE_VALID(_e)   ( (0 <= (_e)) && ((_e) <= ONLP_LED_MODE_PURPLE_BLINKING))
 

Typedefs

typedef enum onlp_led_caps_e onlp_led_caps_t
 
typedef enum onlp_led_mode_e onlp_led_mode_t
 
typedef struct onlp_led_info_s onlp_led_info_t
 

Enumerations

enum  onlp_led_caps_e {
  ONLP_LED_CAPS_OFF = (1 << 0),
  ONLP_LED_CAPS_AUTO = (1 << 1),
  ONLP_LED_CAPS_AUTO_BLINKING = (1 << 2),
  ONLP_LED_CAPS_CHAR = (1 << 3),
  ONLP_LED_CAPS_RED = (1 << 4),
  ONLP_LED_CAPS_RED_BLINKING = (1 << 5),
  ONLP_LED_CAPS_ORANGE = (1 << 6),
  ONLP_LED_CAPS_ORANGE_BLINKING = (1 << 7),
  ONLP_LED_CAPS_YELLOW = (1 << 8),
  ONLP_LED_CAPS_YELLOW_BLINKING = (1 << 9),
  ONLP_LED_CAPS_GREEN = (1 << 10),
  ONLP_LED_CAPS_GREEN_BLINKING = (1 << 11),
  ONLP_LED_CAPS_BLUE = (1 << 12),
  ONLP_LED_CAPS_BLUE_BLINKING = (1 << 13),
  ONLP_LED_CAPS_PURPLE = (1 << 14),
  ONLP_LED_CAPS_PURPLE_BLINKING = (1 << 15)
}
 
enum  onlp_led_mode_e {
  ONLP_LED_MODE_OFF,
  ONLP_LED_MODE_AUTO,
  ONLP_LED_MODE_AUTO_BLINKING,
  ONLP_LED_MODE_CHAR,
  ONLP_LED_MODE_RED,
  ONLP_LED_MODE_RED_BLINKING,
  ONLP_LED_MODE_ORANGE,
  ONLP_LED_MODE_ORANGE_BLINKING,
  ONLP_LED_MODE_YELLOW,
  ONLP_LED_MODE_YELLOW_BLINKING,
  ONLP_LED_MODE_GREEN,
  ONLP_LED_MODE_GREEN_BLINKING,
  ONLP_LED_MODE_BLUE,
  ONLP_LED_MODE_BLUE_BLINKING,
  ONLP_LED_MODE_PURPLE,
  ONLP_LED_MODE_PURPLE_BLINKING,
  ONLP_LED_MODE_LAST = ONLP_LED_MODE_PURPLE_BLINKING,
  ONLP_LED_MODE_COUNT,
  ONLP_LED_MODE_INVALID = -1
}
 

Functions

int onlp_led_sw_init (void)
 Software initialization of the LED module.
 
int onlp_led_hw_init (uint32_t flags)
 Hardware initialization of the LED module.
 
int onlp_led_sw_denit (void)
 Deinitialize the led software module. More...
 
int onlp_led_hdr_get (onlp_oid_t oid, onlp_oid_hdr_t *rv)
 Get the LED header. More...
 
int onlp_led_info_get (onlp_oid_t oid, onlp_led_info_t *rv)
 Get LED information. More...
 
int onlp_led_caps_get (onlp_oid_t oid, uint32_t *caps)
 Get the LED caps. More...
 
int onlp_led_mode_set (onlp_oid_t oid, onlp_led_mode_t mode)
 Set the LED mode. More...
 
int onlp_led_char_set (onlp_oid_t oid, char c)
 Set the LED char. More...
 
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. More...
 
int onlp_led_info_to_json (onlp_led_info_t *info, cJSON **cj, uint32_t flags)
 Convert an LED info structure to JSON. More...
 
int onlp_led_info_from_json (cJSON *cj, onlp_led_info_t *info)
 Convert a JSON object to an LED info structure. More...
 
const char * onlp_led_caps_name (onlp_led_caps_t e)
 
int onlp_led_caps_value (const char *str, onlp_led_caps_t *e, int substr)
 
const char * onlp_led_caps_desc (onlp_led_caps_t e)
 
int onlp_led_caps_valid (onlp_led_caps_t e)
 
const char * onlp_led_mode_name (onlp_led_mode_t e)
 
int onlp_led_mode_value (const char *str, onlp_led_mode_t *e, int substr)
 
const char * onlp_led_mode_desc (onlp_led_mode_t e)
 

Variables

aim_map_si_t onlp_led_caps_map []
 
aim_map_si_t onlp_led_caps_desc_map []
 
aim_map_si_t onlp_led_mode_map []
 
aim_map_si_t onlp_led_mode_desc_map []
 

Detailed Description

Macro Definition Documentation

◆ ONLP_LED_CAPS_VALID

#define ONLP_LED_CAPS_VALID (   _e)    (onlp_led_caps_valid((_e)))

validator

◆ ONLP_LED_MODE_STRINGS

#define ONLP_LED_MODE_STRINGS
Value:
{\
"OFF", \
"AUTO", \
"AUTO_BLINKING", \
"CHAR", \
"RED", \
"RED_BLINKING", \
"ORANGE", \
"ORANGE_BLINKING", \
"YELLOW", \
"YELLOW_BLINKING", \
"GREEN", \
"GREEN_BLINKING", \
"BLUE", \
"BLUE_BLINKING", \
"PURPLE", \
"PURPLE_BLINKING", \
}

Strings macro.

◆ ONLP_LED_MODE_VALID

#define ONLP_LED_MODE_VALID (   _e)    ( (0 <= (_e)) && ((_e) <= ONLP_LED_MODE_PURPLE_BLINKING))

validator

Typedef Documentation

◆ onlp_led_caps_t

onlp_led_caps

◆ onlp_led_info_t

LED information structure.

◆ onlp_led_mode_t

onlp_led_mode

Enumeration Type Documentation

◆ onlp_led_caps_e

onlp_led_caps

36  {
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),
enum onlp_led_caps_e onlp_led_caps_t

◆ onlp_led_mode_e

onlp_led_mode

56  {
57  ONLP_LED_MODE_OFF,
58  ONLP_LED_MODE_AUTO,
59  ONLP_LED_MODE_AUTO_BLINKING,
60  ONLP_LED_MODE_CHAR,
61  ONLP_LED_MODE_RED,
62  ONLP_LED_MODE_RED_BLINKING,
63  ONLP_LED_MODE_ORANGE,
64  ONLP_LED_MODE_ORANGE_BLINKING,
65  ONLP_LED_MODE_YELLOW,
66  ONLP_LED_MODE_YELLOW_BLINKING,
67  ONLP_LED_MODE_GREEN,
68  ONLP_LED_MODE_GREEN_BLINKING,
69  ONLP_LED_MODE_BLUE,
70  ONLP_LED_MODE_BLUE_BLINKING,
71  ONLP_LED_MODE_PURPLE,
72  ONLP_LED_MODE_PURPLE_BLINKING,
73  ONLP_LED_MODE_LAST = ONLP_LED_MODE_PURPLE_BLINKING,
74  ONLP_LED_MODE_COUNT,
75  ONLP_LED_MODE_INVALID = -1,
enum onlp_led_mode_e onlp_led_mode_t

Function Documentation

◆ onlp_led_caps_desc()

const char* onlp_led_caps_desc ( onlp_led_caps_t  e)

Enum descriptions.

◆ onlp_led_caps_get()

int onlp_led_caps_get ( onlp_oid_t  oid,
uint32_t *  caps 
)

Get the LED caps.

Parameters
oidThe LED OID.
[out]capsReceives the caps.

◆ onlp_led_caps_name()

const char* onlp_led_caps_name ( onlp_led_caps_t  e)

Enum names.

◆ onlp_led_caps_valid()

int onlp_led_caps_valid ( onlp_led_caps_t  e)

Enum validator.

◆ onlp_led_caps_value()

int onlp_led_caps_value ( const char *  str,
onlp_led_caps_t e,
int  substr 
)

Enum values.

◆ onlp_led_char_set()

int onlp_led_char_set ( onlp_oid_t  oid,
char  c 
)

Set the LED char.

Parameters
oidThe LED OID
cThe character.
Note
Only relevant if the LED supports the char capability.

◆ onlp_led_hdr_get()

int onlp_led_hdr_get ( onlp_oid_t  oid,
onlp_oid_hdr_t rv 
)

Get the LED header.

Parameters
oidThe LED OID
[out]rvReceives the header.

◆ onlp_led_info_from_json()

int onlp_led_info_from_json ( cJSON *  cj,
onlp_led_info_t info 
)

Convert a JSON object to an LED info structure.

Parameters
cjThe JSON oibject.
[out]infoReceives the LED info structure.

◆ onlp_led_info_get()

int onlp_led_info_get ( onlp_oid_t  oid,
onlp_led_info_t rv 
)

Get LED information.

Parameters
oidThe LED OID.
[out]rvReceives the information structure.

◆ onlp_led_info_to_json()

int onlp_led_info_to_json ( onlp_led_info_t info,
cJSON **  cj,
uint32_t  flags 
)

Convert an LED info structure to JSON.

Parameters
infoThe LED info structure.
[out]cjReceives the JSON object.
flagsThe JSON format flags.

◆ onlp_led_info_to_user_json()

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.

Parameters
infoThe LED info structure.
[out]cjReceives the JSON object.
flagsThe JSON format flags.

◆ onlp_led_mode_desc()

const char* onlp_led_mode_desc ( onlp_led_mode_t  e)

Enum descriptions.

◆ onlp_led_mode_name()

const char* onlp_led_mode_name ( onlp_led_mode_t  e)

Enum names.

◆ onlp_led_mode_set()

int onlp_led_mode_set ( onlp_oid_t  oid,
onlp_led_mode_t  mode 
)

Set the LED mode.

Parameters
oidThe LED OID.
modeThe mode. .
Note
Only relevant if the LED supports the color capability.

◆ onlp_led_mode_value()

int onlp_led_mode_value ( const char *  str,
onlp_led_mode_t e,
int  substr 
)

Enum values.

◆ onlp_led_sw_denit()

int onlp_led_sw_denit ( void  )

Deinitialize the led software module.

Note
The primary purpose of this API is to properly deallocate any resources used by the module in order faciliate detection of real resouce leaks.

Variable Documentation

◆ onlp_led_caps_desc_map

aim_map_si_t onlp_led_caps_desc_map[]

onlp_led_caps_desc_map table.

◆ onlp_led_caps_map

aim_map_si_t onlp_led_caps_map[]

onlp_led_caps_map table.

◆ onlp_led_mode_desc_map

aim_map_si_t onlp_led_mode_desc_map[]

onlp_led_mode_desc_map table.

◆ onlp_led_mode_map

aim_map_si_t onlp_led_mode_map[]

onlp_led_mode_map table.