GxPsUpgradeFirmwareStatus

Purpose

Monitor the firmware upgrade process.

Syntax

GxPsUpgradeFirmwareStatus (nHandle, pszMsg, nMsgMaxLen, pnProgress, pbIsDone, pnStatus)

Parameters

Name
Type
Description
nHandle
SHORT
Handle for a GX7400 board.
pszMsg
PSTR
Buffer to contain the message from the firmware upgrade process.
nMSsgMazLen
SHORT
pszMsgbuffer size .
pnProgress
PSHORT
Returns the firmware upgrades progress.
pbIsDone
PBOOL
Returned TRUE if the firmware upgrades is done.
pnStatus
LPSHORT
Returned status: 0 on success, negative number on failure, >0 for warning.

Comments

This function is used in order to monitor the firmware upgrade process whenever the user called GxPsUpgradeFirmware 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.

Example

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;

GxPsUpgradeFirmware (nHandle, “C:\\Gx7400Fw.JAM”, GT_UPGRADE_FIRMWARE_MODE_ASYNC, &nStatus);

if (nStatus<0)

{   GxPsGetErrorString(nStatus, sz, sizeof sz, &nStatus);

    printf(sz); // prints the error string returns

}

While (bIsDone==FALSE || nStatus<0)

{   GxPsUpgradeFirmwareStatus (nHandle, szMsg, sizeof szMsg, &nProgress, &bIsDone, &nStatus);

    printf(“Upgrade Progress %i”, nProgress);

    sleep(1000);

}

if (nStatus<0)

{   GxPsGetErrorString(nStatus, sz, sizeof sz, &nStatus);

    printf(sz); // prints the error string returns

}

 

See Also

GxPsUpgradeFirmware, GxPsGetErrorString