dmi_entity_info
Synopsis
#include <opendmi/entity.h>
void *dmi_entity_info(const dmi_entity_t *entity, const dmi_type_t *type);
Description
The dmi_entity_info function returns a pointer to the decoded structure
descriptor for the given entity. The entity type is verified against the
expected type parameter before returning the data.
The returned pointer should be cast to the appropriate type-specific structure
(e.g., dmi_cooling_device_t * for cooling device entities). The entity must
have been previously decoded with dmi_entity_decode.
The type is the structure type of the specification the structure is decoded
by, see dmi_type, rather than the number the structure is found at. Some
vendors place structures defined by others at type numbers of their own, e.g.
Dell moves Intel reference code structures 16 types down, and such a structure
is still of the type of its original specification, since its data is laid out
as that type expects, while dmi_entity_type_id returns the type number
found in the table. Structures of different types sharing a type number, e.g.
Intel vPro information and Lenovo ThinkVantage Technologies enablement, are
told apart, so the pointer returned is always of the C type of type.
Return value
Returns a pointer to the decoded structure descriptor. Returns nullptr if
entity is nullptr, the entity has not been decoded, or the entity type does
not match type.