dmi_cooling_device
Synopsis
#include <opendmi/entity/cooling-device.h>
typedef struct dmi_cooling_device {
dmi_handle_t probe_handle;
dmi_entity_t *probe;
dmi_cooling_device_type_t type;
dmi_status_t status;
unsigned short group;
uint32_t oem_defined;
short nominal_speed;
const char *description;
} dmi_cooling_device_t;
Description
The dmi_cooling_device_t structure holds the decoded cooling device
structure (type 27) of SMBIOS: the type, status, redundancy group and nominal
speed of one cooling device of the system, such as a fan or a heat pipe, and
the temperature probe monitoring it. A table carries one such structure for
each cooling device.
The structure is returned by dmi_entity_info for the structures of type
DMI_TYPE(cooling_device), and lives as long as the context it has been
decoded in.
Fields
probe_handle-
Handle of the temperature probe (type 28) monitoring this cooling device.
DMI_HANDLE_INVALIDorDMI_HANDLE_UNSUPPORTEDmean that no probe is set. probe-
Temperature probe monitoring this cooling device, or
nullptrif no probe is set, if the table has no structure with the handle, or if that structure is not a temperature probe. It is set when the structure is linked. type-
Type of the cooling device, see
dmi_cooling_device_type. status-
Status of the cooling device, see
dmi_status. group-
Cooling unit group of the device, or 0 if the device belongs to no redundant cooling unit. Devices with the same non-zero group form a redundant unit, so a table has at least two of them.
oem_defined-
Information specific to the OEM or to the firmware vendor.
nominal_speed-
Nominal rotational speed of the device, in revolutions per minute, or
SHRT_MINif the speed is unknown, if the device does not rotate, or if the structure ends before this field (its length is 0x0C). description-
Additional description of the device or of its location, or
nullptrif the structure has none. Present since SMBIOS 2.7.
Examples
dmi_registry_t *registry = dmi_get_registry(context);
dmi_entity_t *entity = dmi_registry_lookup_first(registry,
DMI_TYPE(cooling_device), false);
dmi_cooling_device_t *device = dmi_entity_info(entity,
DMI_TYPE(cooling_device));
if (device != nullptr) {
printf("type: %s\n", dmi_cooling_device_type_name(device->type));
printf("status: %s\n", dmi_status_name(device->status));
printf("description: %s\n",
device->description ? device->description : "unspecified");
if (device->nominal_speed != SHRT_MIN)
printf("speed: %d rpm\n", device->nominal_speed);
}