X hits on this document

PDF document

February 10, 2006 - page 158 / 238

623 views

0 shares

0 downloads

0 comments

158 / 238

146

CHAPTER 9. CONTROLS AND MISCELLANY

The function:

char *ipmi_control_get_type_string(ipmi_control_t *control);

returns a string representation of the control type for the control.

Some controls may have multiple objects that cannot be independently controlled. For example, if a message is sent to set the value of three LEDs and it has one byte for each LED and no way to set “only set this one”, then there is no generally and guaranteed way to independently control each LED. In these cases, OpenIPMI represents these as a control with multiple values. When setting, all the values must be specified. When reading, all the values are returned. To get the number of values for a control, use the following function:

i n t i p m i _ c o n t r o l _ g e t _ n u m _ v a l s ( i p m i _ c o n t r o l _ t * c o n t r o l ) ;

Control Entity Information

Every control is associated with a specific entity, these calls let you fetch the entity information. The following calls return the numeric entity id and instance:

i n t i p m i _ c o n t r o l _ g e t _ e n t i t y _ i d ( i p m i _ c o n t r o l _ t * c o n t r o l ) ; i n t i p m i _ c o n t r o l _ g e t _ e n t i t y _ i n s t a n c e ( i p m i _ c o n t r o l _ t * c o n t r o l ) ;

Generally, though, that is note what you want. You want the actual entity object, which may be fetched with the following:

i p m i _ e n t i t y _ t * i p m i _ c o n t r o l _ g e t _ e n t i t y ( i p m i _ c o n t r o l _ t * c o n t r o l ) ;

Note that the entity is refcounted when the control is claimed, so the entity will exist while you have a valid reference to a control it contains.

9.1.1

Control

Name

Controls are given a name by the OEM code that creates them. This is useful for printing out control information. The functions to get this are:

i n t i p m i _ c o n t r o l _ g e t _ i d _ l e n g t h ( i p m i _ c o n t r o l _ t * c o n t r o l ) ; e n u m i p m i _ s t r _ t y p e _ e i p m i _ c o n t r o l _ g e t _ i d _ t y p e ( i p m i _ c o n t r o l _ t * c o n t r o l int ipmi_control_get_id(ipmi_control_t *control, char *id, int length); ) ;

See appendix A.1 for more information about these strings. The function

int ipmi_control_get_name(ipmi_control_t *control, char *name, int length);

returns a fully qualified name for the control with the entity name prepended. The name array is filled with the name, up to the length given. This is useful for printing string names for the control.

Document info
Document views623
Page views623
Page last viewedThu Dec 08 00:08:53 UTC 2016
Pages238
Paragraphs8090
Words85809

Comments