ONLP
Open Network Linux Platform APIs
Macros | Functions

Macros

#define ONLP_LED_INFO_ENTRY_INIT(_id, _desc, _parent, _caps)
 
#define ONLP_CHASSIS_LED_INFO_ENTRY_INIT(_id, _desc, _caps)   ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_OID_CHASSIS, _caps)
 
#define ONLP_PSU_LED_INFO_ENTRY_INIT(_id, _desc, _psu_id, _caps)   ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_PSU_ID_CREATE(_psu_id), _caps)
 
#define ONLP_FAN_LED_INFO_ENTRY_INIT(_id, _desc, _fan_id, _caps)   ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_FAN_ID_CREATE(_fan_id), _caps)
 

Functions

int onlp_ledi_sw_init (void)
 Software initialization of the LED module.
 
int onlp_ledi_hw_init (uint32_t flags)
 Hardware initialization of the LED module. More...
 
int onlp_ledi_sw_denit (void)
 Deinitialize the led software module. More...
 
int onlp_ledi_id_validate (onlp_oid_id_t id)
 Validate an LED id. More...
 
int onlp_ledi_hdr_get (onlp_oid_id_t id, onlp_oid_hdr_t *rv)
 Get the LED header. More...
 
int onlp_ledi_info_get (onlp_oid_id_t id, onlp_led_info_t *rv)
 Get the information for the given LED. More...
 
int onlp_ledi_caps_get (onlp_oid_id_t id, uint32_t *rv)
 Get the caps for the given LED. More...
 
int onlp_ledi_mode_set (onlp_oid_id_t id, onlp_led_mode_t mode)
 Set the LED mode. More...
 
int onlp_ledi_char_set (onlp_oid_id_t id, char c)
 Set the LED character. More...
 

Detailed Description

Macro Definition Documentation

◆ ONLP_CHASSIS_LED_INFO_ENTRY_INIT

#define ONLP_CHASSIS_LED_INFO_ENTRY_INIT (   _id,
  _desc,
  _caps 
)    ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_OID_CHASSIS, _caps)

Initialize a static chassis LED OID entry

◆ ONLP_FAN_LED_INFO_ENTRY_INIT

#define ONLP_FAN_LED_INFO_ENTRY_INIT (   _id,
  _desc,
  _fan_id,
  _caps 
)    ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_FAN_ID_CREATE(_fan_id), _caps)

Initialize a static Fan LED OID Entry

◆ ONLP_LED_INFO_ENTRY_INIT

#define ONLP_LED_INFO_ENTRY_INIT (   _id,
  _desc,
  _parent,
  _caps 
)
Value:
{ \
{ \
.id = ONLP_LED_ID_CREATE(_id), \
.description = _desc, \
.poid = ONLP_OID_CHASSIS, \
.status = ONLP_OID_STATUS_FLAG_PRESENT, \
}, \
.caps = _caps, \
}
#define ONLP_OID_CHASSIS
Definition: oids.h:260
#define ONLP_LED_ID_CREATE(_id)
Definition: oids.h:159

Initialize an LED static OID entry

◆ ONLP_PSU_LED_INFO_ENTRY_INIT

#define ONLP_PSU_LED_INFO_ENTRY_INIT (   _id,
  _desc,
  _psu_id,
  _caps 
)    ONLP_LED_INFO_ENTRY_INIT(_id, _desc, ONLP_PSU_ID_CREATE(_psu_id), _caps)

Initialize a static PSU LED OID Entry

Function Documentation

◆ onlp_ledi_caps_get()

int onlp_ledi_caps_get ( onlp_oid_id_t  id,
uint32_t *  rv 
)

Get the caps for the given LED.

Parameters
idThe LED ID
[out]rvReceives the caps.

◆ onlp_ledi_char_set()

int onlp_ledi_char_set ( onlp_oid_id_t  id,
char  c 
)

Set the LED character.

Parameters
idThe LED OID
cThe character..
Note
Only called if the char capability is set.

◆ onlp_ledi_hdr_get()

int onlp_ledi_hdr_get ( onlp_oid_id_t  id,
onlp_oid_hdr_t rv 
)

Get the LED header.

Parameters
idThe LED OID
[out]rvReceives the header.

◆ onlp_ledi_hw_init()

int onlp_ledi_hw_init ( uint32_t  flags)

Hardware initialization of the LED module.

Parameters
flagsThe hardware initialization flags.

◆ onlp_ledi_id_validate()

int onlp_ledi_id_validate ( onlp_oid_id_t  id)

Validate an LED id.

Parameters
idThe id.

◆ onlp_ledi_info_get()

int onlp_ledi_info_get ( onlp_oid_id_t  id,
onlp_led_info_t rv 
)

Get the information for the given LED.

Parameters
idThe LED OID
[out]rvReceives the LED information.

◆ onlp_ledi_mode_set()

int onlp_ledi_mode_set ( onlp_oid_id_t  id,
onlp_led_mode_t  mode 
)

Set the LED mode.

Parameters
idThe LED OID
modeThe new mode.
Note
Only called if the mode is advertised in the LED capabilities.

◆ onlp_ledi_sw_denit()

int onlp_ledi_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.