X hits on this document

PDF document

February 10, 2006 - page 162 / 238





162 / 238



_ _ ipmi light setting_t *settings,


_ *cb data);



t y p e d e f v o i d ( * i p m i _ l i g h t _ s e t t i n g s _ c b ) ( i p m i _ c o n t r o l _ t


Once you receive the settings, use the get functions to get the data you want from it. Note that the settings parameter is freed by the system; if you want to keep the settings around you should duplicate them. To set the settings of a light control, first create and configure a light setting object, then pass it to:


* c b _ d a t a ) ;

i n t i p m i _ c o n t r o l _ g e t _ l i g h t ( i p m i _ c o n t r *control, o l _ t i p m i _ l i g h t _ s e t t i n g s _ c b h a n d l e r ,







i n t i p m i _ c o n t r o l _ s e t _ l i g h t ( i p m i _ c o n t r o l _ t


l i g h t _ s e t t i n g _ t * s e t t i n g s ,


* c b _ d a t a ) ;

Transition Light

For a transition light control, each control has one or more lights. Each light is an lightable device, but all the lights in a control are changed together. To get the number of lights supported by a control, use:

int ipmi_control_get_num_vals(ipmi_control_t *control);

Each light has a number of values that it may be set to. The value is what is passed to set_control. S e e s e c t i o n 9 . 1 . 3 o n p a g e 1 4 7 f o r d e t a i l s o n h o w t o u s e s e t _ c o n t r o l . T o fi n d t h e n u m b e r o f v a l u e s f o r light, use a

int ipmi_control_get_num_light_values(ipmi_control_t *control, light);

Each value of a light has a number of transitions that it may go through. Each transition has a color and a time when that colors runs.

This all sounds complicated, but it is really fairly simple. Suppose a control has two lights. Say light 0 is a red led. Light 0 has 4 values: off, 100ms on and 900ms off, 900ms on and 100ms off, and always on. For value 0, it will have one transition and the color will be black (time is irrelevant with one transition). For value 1, it will have two transitions, the first has a color of black and a time of 900 and the second has a color of red and a time of 100. Likewise, value 2 has two transitions, the first is black with a time of 100 and the second is red with a value of 900. Value 4 has one transition with a red color.

To get the number of transitions in a value, call the function:

_ _ _ _ int ipmi control_get num light transitions(ipmi_control


t *control,

unsigned int


unsigned int


For each transition, use the following functions to fetch the color and time for that transition:

i n t i p m i _ c o n t r o l _ g e t _ l i g h t _ c o l o r ( i p m i _ c o n t r o unsigned int unsigned int l


t *control, light, value,

Document info
Document views1093
Page views1093
Page last viewedSun Jan 22 02:25:10 UTC 2017