Monitor the firmware upgrade process.
GxFpgaUpgradeFirmwareStatus (nHandle, pszMsg, nMsgMaxLen, pnProgress, pbIsDone, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle for a GX3500 board. |
pszMsg |
PSTR |
Buffer to contain the message from the firmware upgrade process. |
nMsgMaxLen |
SHORT |
pszMsg buffer size . |
pnProgress |
PSHORT |
Returns the firmware upgrades progress. |
pbIsDone |
PBOOL |
Returned TRUE if the firmware upgrades are done. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
This function is used in order to monitor the firmware upgrade process whenever the user called GxFpgaUpgradeFirmware API with GT_ FIRMWARE_UPGRADE_MODE_ASYNC mode.
Note: In order to prevent CPU over load if the function is called form within a loop, a delay of about 500mSec will be activated if the time differences between consecutive calls are less than 500mSec.
The following example loads Upgrades the board’s firmware using asynchronous mode, and ten monitors the firmware upgrade process:
CHAR sz[256];
CHAR szMsg[256];
BOOL bIsDone=FALSE;
GxFpgaUpgradeFirmware (nHandle, “C:\\Gx3500Fw.rpd”, GT_UPGRADE_FIRMWARE_MODE_ASYNC, &nStatus);
if (nStatus<0)
{ GxFpgaGetErrorString(nStatus, sz, sizeof sz, &nStatus);
printf(sz); // prints the error string returns
}
While (bIsDone==FALSE || nStatus<0)
{ GxFpgaUpgradeFirmwareStatus (nHandle, szMsg, sizeof szMsg, &nProgress, &bIsDone, &nStatus);
printf(“Upgrade Progress %i”, nProgress);
sleep(1000);
}
if (nStatus<0)
{ GxFpgaGetErrorString(nStatus, sz, sizeof sz, &nStatus);
printf(sz); // prints the error string returns
}