dsmi_upgrade_get_state
Prototype
int dsmi_upgrade_get_state(int device_id, unsigned char *schedule, unsigned char *upgrade_status)
Description
Obtains the progress and status of the Firmware upgrade.
For the Ascend 310 AI Processor, this API supports mini modules (EP) and 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. |
schedule |
Output |
Upgrade progress (%) |
upgrade_status |
Output |
Upgrade status typedef enum { DSMI_UPGRADE_STATE_IDLE, DSMI_UPGRADE_STATE_UPDATING, DSMI_UPGRADE_STATE_NONSUPPORT, DSMI_UPGRADE_STATE_FAIL, DSMI_UPGRADE_STATE_NONE }DSMI_UPGRADE_STATE; |
Returns
Type |
Description |
---|---|
int |
0 on success; else, failure |
Restrictions
Run the caller application as the root user. Otherwise, a permission error is returned.
Example
int ret = 0; unsigned char schedule; unsigned char upgrade_status; ret = dsmi_upgrade_get_state(0, &schedule, & upgrade_status); if(ret != 0) { //To-do: records logs. return ret; }