GxCntUpgradeFirmwareStatus

Purpose

Monitor the firmware upgrade process.

Syntax

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

Parameters

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

Comments

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

GxCntUpgradeFirmware (nHandle, “C:\\ GxCntFw.jam”, GT_UPGRADE_FIRMWARE_MODE_ASYNC, &nStatus);

if (nStatus<0)

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

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

}

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

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

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

sleep(1000);

}

if (nStatus<0)

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

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

}

 

See Also

GxCntUpgradeFirmware, GxCntGetErrorString