dsmi_get_mini2mcu_heartbeat_status
Prototype
int dsmi_get_mini2mcu_heartbeat_status(int device_id, unsigned char *status,unsigned int *disconn_cnt)
Description
Obtains the status and count of the device to MCU heartbeat. If multiple devices are in connect state, the smaller the disconn_cnt value is, the more stable the connection is. Only one device of a standard PCIe card is connected to the MCU at a time.
For the Ascend 310 AI Processor, this API supports only standard PCIe cards.
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. |
status |
Output |
Heartbeat status 0: disconnected 1: connected |
disconn_cnt |
Output |
Heartbeat disconnection count Value range: 0–9999 |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure 1 indicates that the heartbeat status of the current device cannot be queried. |
Restrictions
Run the caller application on a physical machine. Otherwise, a permission error is returned.
Example
int ret = 0; unsigned char tmp_status = 0; unsigned int tmp_disconn_cnt = 0; ret =dsmi_get_mini2mcu_heartbeat_status(2, &tmp_status, &tmp_disconn_cnt); if(ret != 0) { //To-do: records logs. return ret; } ...