dsmi_get_device_alarminfo
Prototype
int dsmi_get_device_alarminfo(int device_id, int* alarmcount, struct dsmi_alarm_info_stru *palarminfo)
Description
Obtains the alarm information of a device. Mini modules (EP) and standard PCIe cards are supported.
Parameters
Parameter |
Input/Output |
Description |
---|---|---|
device_id |
Input |
Device ID ranging from 0 to 63, which can be obtained by calling dsmi_list_device |
alarmcount |
Output |
Alarm count ranging from 0 to 128 |
palarminfo |
Output |
Alarm information. For details about the alarm information, see Ascend 310 Troubleshooting Guide. |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Exception Handling
None
Restrictions
None
Example
#define ALARM_INFO_MAX_NUM (128) ... int ret = 0; int alarmcount = 0; struct dsmi_alarm_info_stru *palarminfo = NULL; palarminfo = (struct dsmi_alarm_info_stru *)malloc(sizeof(struct dsmi_alarm_info_stru) * ALARM_INFO_MAX_NUM); if (!palarminfo) { //To-do: records logs. return –ENOMEM; } ret = dsmi_get_device_alarminfo(0, &alarmcount, palarminfo); if(ret != 0) { //To-do: records logs. return ret; } free(palarminfo); ...