X hits on this document

PDF document

February 10, 2006 - page 162 / 238

516 views

0 shares

0 downloads

0 comments

162 / 238

int

err,

_ _ ipmi light setting_t *settings,

void

_ *cb data);

150

CHAPTER 9. CONTROLS AND MISCELLANY

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

*control,

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:

void

* 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 ,

ipmi

_

ipmi

_

control_op_cb

handler,

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

*control,

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

void

* 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

light,

unsigned int

value);

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 views516
Page views516
Page last viewedSat Dec 03 05:26:56 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments