dsmi_get_fan_speed
Prototype
int dsmi_get_fan_speed(int device_id, int fan_id, int *speed)
Description
Obtains the actual fan speed (in RPM).
Mini modules (EP) are supported.
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
device_id |
Input |
Device ID For the Ascend 310 AI Processor, the value range is 0–63. Obtain the actual device ID by calling dsmi_list_device. |
fan_id |
Input |
Fan ID, indexed starting at 1. Pass 0 to obtain the average speed of all fans. |
speed |
Output |
Fan speed array, allocated by the caller The fan speed unit is RPM, that is, revolutions per minute. Value range: 0 to 18000±10% |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
None
Example
int ret = 0; int speed = 0; int count = 0; ret = dsmi_get_fan_count(0, &count); ... for (i = 1; i <= count; i++){ ret = dsmi_get_fan_speed(0, i, &speed); if(ret != 0) { //To-do: records logs. return ret; } ... } ...