Impact Acquire SDK Java
FirmwareUpdater Class Reference

A class to perform a firmware update of a specific device. More...

Public Member Functions

synchronized void delete ()
 
 FirmwareUpdater (Device pDev)
 Creates a new mvIMPACT.acquire.FirmwareUpdater object.
 
 FirmwareUpdater (Device pDev, boolean boForceOverideSameVersion)
 Creates a new mvIMPACT.acquire.FirmwareUpdater object.
 
 FirmwareUpdater (Device pDev, boolean boForceOverideSameVersion, boolean boForceDowngrade)
 Creates a new mvIMPACT.acquire.FirmwareUpdater object.
 
 FirmwareUpdater (Device pDev, boolean boForceOverideSameVersion, boolean boForceDowngrade, boolean boKeepUserSets)
 Creates a new mvIMPACT.acquire.FirmwareUpdater object.
 
 FirmwareUpdater (Device pDev, boolean boForceOverideSameVersion, boolean boForceDowngrade, boolean boKeepUserSets, boolean boForceBreakingChange)
 Creates a new mvIMPACT.acquire.FirmwareUpdater object.
 
PropertyI getFirmwareVersionToUpload ()
 An enumerated integer property containing a list of available firmware versions.
 
double getTimeElapsed ()
 A method to receive the time in seconds since the update process has been started.
 
int onErasingFlash (int currentProgress_pc, double timeElapsed_s)
 This function will be called once the devices flash memory is erased.
 
int onErrorMessage (double timeElapsed_s)
 This function will be called once a message is waiting to be passed to the user.
 
int onHardResetRequired (int currentProgress_pc, double timeElapsed_s)
 This function will be called once the device reboots and a manual hard reset is required.
 
int onLoadingUserSets (int currentProgress_pc, double timeElapsed_s)
 This function will be called when the settings of the device are written back after updating the firmware.
 
int onRebooting (int currentProgress_pc, double timeElapsed_s)
 This function will be called once the device reboots to make sure the new firmware is applied to the device.
 
int onSavingUserSets (int currentProgress_pc, double timeElapsed_s)
 This function will be called when the settings of the device are stored before updating the firmware.
 
int onUnzippingFirmwareArchive (int currentProgress_pc, double timeElapsed_s)
 This function will be called once firmware archive (*.mvu) is unzipped to provide the correct firmware file.
 
int onUpdatingBootProgrammer (int currentProgress_pc, double timeElapsed_s)
 This function will be called once the boot programmer of an mvBlueFOX3 camera is updated.
 
int onUploadingImage (int currentProgress_pc, double timeElapsed_s)
 This function will be called once the actual firmware file is uploaded to the device's flash memory.
 
String statusMessage ()
 Returns the current status from the status property.
 
void swigReleaseOwnership ()
 
void swigTakeOwnership ()
 
int update ()
 A function to start the firmware update process.
 
int update (String archivePath)
 A function to start the firmware update process.
 
int update (String archivePath, boolean boUpdateDataAsNeeded)
 A function to start the firmware update process.
 

Static Public Member Functions

static int verifyFirmwareChecksum (Device pDev, String archivePath)
 A function to check the integrity of the firmware running on a device.
 
static int verifyFirmwareChecksum (Device pDev, String archivePath, SWIGTYPE_p_std__string pStatusMessage)
 A function to check the integrity of the firmware running on a device.
 

Protected Member Functions

void finalize ()
 
 FirmwareUpdater (long cPtr, boolean cMemoryOwn)
 
void setTimeElapsed (double time_s)
 
void swigDirectorDisconnect ()
 

Static Protected Member Functions

static long swigRelease (FirmwareUpdater obj)
 

Protected Attributes

transient boolean swigCMemOwn
 

Detailed Description

A class to perform a firmware update of a specific device.

This class is intended to provide an ease of use possibility to update the firmware of specific devices. It is possible to specify the behavior of the class very detailed to make sure the update suits the users expectations. It is also possible to derive from this class and override various functions in order to get custom notifications e.g. to update a GUI application.

To start a firmware update for Balluff GenICam devices the following code will be sufficient:

// force the update even if the version of the mvu-file is the same as the one on the device
mvIMPACT.acquire.FirmwareUpdater fwUpdater = new mvIMPACT.acquire.FirmwareUpdater( pDev, true );
try
{
String pathToMVUfile = new String( "someArchive.mvu" );
// start the whole update process
System.out.println( "Result of firmware update call: " + ImpactAcquireException.getErrorCodeAsString( pFWU.update( pathToMVUfile ) ) );
}
{
System.out.println( "An error occured during the firmware update process. Error code: " + e.getErrorCodeAsString() );
System.out.println( "Status: " + pFWU.statusMessage() );
}
A class to perform a firmware update of a specific device.
Definition FirmwareUpdater.java:304
FirmwareUpdater(long cPtr, boolean cMemoryOwn)
Definition FirmwareUpdater.java:308
A base class for exceptions generated by Impact Acquire.
Definition ImpactAcquireException.java:15
String getErrorCodeAsString()
Returns a string representation of the error associated with the exception.
Definition ImpactAcquireException.java:88

To start a firmware update for Balluff mvBlueFOX devices the following code will be sufficient:

mvIMPACT.acquire.FirmwareUpdater fwUpdater = new mvIMPACT.acquire.FirmwareUpdater( pDev );
// if necessary, a specific version for the update can be selected by using the firmwareVersionToUpload property
try
{
// start the whole update process
System.out.println( "Result of firmware update call: " + ImpactAcquireException.getErrorCodeAsString( pFWU.update() ) );
}
{
System.out.println( "An error occured during the firmware update process. Error code: " + e.getErrorCodeAsString() );
System.out.println( "Status: " + pFWU.statusMessage() );
}

A more custom behavior can be accomplished by deriving from the mvIMPACT.acquire.FirmwareUpdater class and re-implementing the various notification functions:

import mvIMPACT.acquire.*;
public class MyFirmwareUpdater extends FirmwareUpdater
{
public MyFirmwareUpdater( Device pDev, boolean boForceOverideSameVersion, boolean boForceDowngrade, boolean boKeepUserSets, boolean boForceBreakingChange )
{
super( pDev, boForceOverideSameVersion, boForceDowngrade, boKeepUserSets, boForceBreakingChange );
}
@Override
public int onErrorMessage( double timeElapsed_s )
{
System.out.println( "Error: " + statusMessage() + " @ " + timeElapsed_s + " s" );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaContinue;
}
@Override
public int onErasingFlash( int currentProgress_pc, double timeElapsed_s )
{
System.out.println( "Erasing - Update progress: " + currentProgress_pc + ", time " + timeElapsed_s + " s" );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaContinue;
}
@Override
public int onUnzippingFirmwareArchive( int currentProgress_pc, double timeElapsed_s )
{
System.out.println( "Unzipping firmware archive - Update progress: " + currentProgress_pc + ", time " + timeElapsed_s + " s" );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaContinue;
}
@Override
public int onUpdatingBootProgrammer( int currentProgress_pc, double timeElapsed_s )
{
System.out.println( "Updating boot programmer - Update progress: " + currentProgress_pc + ", time " + timeElapsed_s + " s" );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaContinue;
}
@Override
public int onUploadingImage( int currentProgress_pc, double timeElapsed_s )
{
System.out.println( "Uploading - Update progress: " + currentProgress_pc + ", time " + timeElapsed_s + " s" );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaContinue;
}
@Override
public int onRebooting( int currentProgress_pc, double timeElapsed_s )
{
System.out.println( "Rebooting - Update progress: " + currentProgress_pc + ", time " + timeElapsed_s + " s" );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaContinue;
}
@Override
public int onHardResetRequired( int currentProgress_pc, double timeElapsed_s )
{
System.out.println( "Rebooting - Update progress: " + currentProgress_pc + ", time " + timeElapsed_s + " s" );
System.out.println( "Manual hard reset required." );
System.out.println( "Status message: " + statusMessage() );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaCancel;
}
@Override
public int onSavingUserSets( int currentProgress_pc, double timeElapsed_s )
{
System.out.println( "Saving sets - Update progress: " + currentProgress_pc + ", time " + timeElapsed_s + " s" );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaContinue;
}
@Override
public int onLoadingUserSets( int currentProgress_pc, double timeElapsed_s )
{
System.out.println( "Loading sets - Update progress: " + currentProgress_pc + ", time " + timeElapsed_s + " s" );
return mvIMPACT.acquire.TFirmwareUpdateAction.fuaContinue;
}
}
This class and its functions represent an actual device detected by this interface in the current sys...
Definition Device.java:52
Note
The following device families are currently supported by this API:
  • GenICam compliant Balluff/MATRIX VISION devices
    • BVS CA-GX0 (mvBlueCOUGAR-X)
    • BVS CA-GX2 (mvBlueCOUGAR-XD)
    • BVS CA-GT (mvBlueCOUGAR-XT)
    • BVS CA-SF (mvBlueFOX3)
    • BVS CA-BN (mvBlueNAOS)
  • Other Balluff/MATRIX VISION devices
    • BVS CA-MLC / BVS CA-IGC (mvBlueFOX-MLC/IGC)
    • mvBlueFOX
Attention
  • Do not unplug the device during the update procedure!
  • Once the firmwareUpdate method call returns an error call the mvIMPACT.acquire.FirmwareUpdater.statusMessage function. It will return useful information about the current status (including issues) of the update procedure.
  • The actual mvIMPACT.acquire.FirmwareUpdater.update method did get an additional parameter in version 2.48.0 of this SDK! Make sure you understand the intention of this parameter! When using older versions of this API make sure not attempting to use a device without closing, updating the device list and re-opening it again. Undefined behavior might be the result when not doing so!
Since
2.41.0

Constructor & Destructor Documentation

◆ FirmwareUpdater() [1/6]

FirmwareUpdater ( long cPtr,
boolean cMemoryOwn )
protected

◆ FirmwareUpdater() [2/6]

FirmwareUpdater ( Device pDev,
boolean boForceOverideSameVersion,
boolean boForceDowngrade,
boolean boKeepUserSets,
boolean boForceBreakingChange )

Creates a new mvIMPACT.acquire.FirmwareUpdater object.

Parameters
pDev[in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object.
boForceOverideSameVersion[in] A boolean value which defines if updates using the same version as installed on the camera should be allowed.
boForceDowngrade[in] A boolean value which defines if updates using an older version as installed on the camera should be allowed.
boKeepUserSets[in] A boolean value which defines if the user sets of the device will be kept or will be deleted during the update.
boForceBreakingChange[in] A boolean value which defines if updates to versions which will deliver interface breaking changes will be allowed. Setting this value to true will also update a device which after the update might have a different interface. See documentation for additional information about breaking changes in firmware versions(there are not too many)!

◆ FirmwareUpdater() [3/6]

FirmwareUpdater ( Device pDev,
boolean boForceOverideSameVersion,
boolean boForceDowngrade,
boolean boKeepUserSets )

Creates a new mvIMPACT.acquire.FirmwareUpdater object.

Parameters
pDev[in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object.
boForceOverideSameVersion[in] A boolean value which defines if updates using the same version as installed on the camera should be allowed.
boForceDowngrade[in] A boolean value which defines if updates using an older version as installed on the camera should be allowed.
boKeepUserSets[in] A boolean value which defines if the user sets of the device will be kept or will be deleted during the update. might have a different interface. See documentation for additional information about breaking changes in firmware versions(there are not too many)!

◆ FirmwareUpdater() [4/6]

FirmwareUpdater ( Device pDev,
boolean boForceOverideSameVersion,
boolean boForceDowngrade )

Creates a new mvIMPACT.acquire.FirmwareUpdater object.

Parameters
pDev[in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object.
boForceOverideSameVersion[in] A boolean value which defines if updates using the same version as installed on the camera should be allowed.
boForceDowngrade[in] A boolean value which defines if updates using an older version as installed on the camera should be allowed. might have a different interface. See documentation for additional information about breaking changes in firmware versions(there are not too many)!

◆ FirmwareUpdater() [5/6]

FirmwareUpdater ( Device pDev,
boolean boForceOverideSameVersion )

Creates a new mvIMPACT.acquire.FirmwareUpdater object.

Parameters
pDev[in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object.
boForceOverideSameVersion[in] A boolean value which defines if updates using the same version as installed on the camera should be allowed. might have a different interface. See documentation for additional information about breaking changes in firmware versions(there are not too many)!

◆ FirmwareUpdater() [6/6]

Creates a new mvIMPACT.acquire.FirmwareUpdater object.

Parameters
pDev[in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object. might have a different interface. See documentation for additional information about breaking changes in firmware versions(there are not too many)!

Member Function Documentation

◆ delete()

synchronized void delete ( )

◆ finalize()

void finalize ( )
protected

◆ getFirmwareVersionToUpload()

PropertyI getFirmwareVersionToUpload ( )

An enumerated integer property containing a list of available firmware versions.

Note
This feature currently is only available for mvBlueFOX devices since here the firmware is part of the driver library. So no additional archive is needed, but the desired firmware version to upload into the device's non-volatile memory can be selected by writing to this property before calling the mvIMPACT.acquire.FirmwareUpdater.update function.

◆ getTimeElapsed()

double getTimeElapsed ( )

A method to receive the time in seconds since the update process has been started.

Returns
The time elapsed since the firmware update currently running has been started.

◆ onErasingFlash()

int onErasingFlash ( int currentProgress_pc,
double timeElapsed_s )

This function will be called once the devices flash memory is erased.

Re-implement this function in a derived class in order to implement a custom behaviour.

Note
Only some device types require this step so this callback might not be called for every device type.
Returns
Parameters
currentProgress_pc[in] The current progress of the erase operation (in percent).
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ onErrorMessage()

int onErrorMessage ( double timeElapsed_s)

This function will be called once a message is waiting to be passed to the user.

Re-implement this function in a derived class in order to implement a custom behaviour.

Returns
Parameters
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ onHardResetRequired()

int onHardResetRequired ( int currentProgress_pc,
double timeElapsed_s )

This function will be called once the device reboots and a manual hard reset is required.

Re-implement this function in a derived class in order to implement a custom behaviour.

Note
If this function is called, a power cycle is inevitable. Otherwise the new firmware may be broken. The default is to stop the update at this point, so that the user can manually disconnect the power source.
Returns
Parameters
currentProgress_pc[in] The current progress of the reboot operation (in percent).
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ onLoadingUserSets()

int onLoadingUserSets ( int currentProgress_pc,
double timeElapsed_s )

This function will be called when the settings of the device are written back after updating the firmware.

Re-implement this function in a derived class in order to implement a custom behaviour.

This callback will only be called when user sets shall be available after the update. This can be specified by setting the boKeepUserSets flag upon construction of this object.

Returns
Parameters
currentProgress_pc[in] The current progress of the load operation (in percent).
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ onRebooting()

int onRebooting ( int currentProgress_pc,
double timeElapsed_s )

This function will be called once the device reboots to make sure the new firmware is applied to the device.

Re-implement this function in a derived class in order to implement a custom behaviour.

Note
Returning mvIMPACT.acquire.TFirmwareUpdateAction.fuaCancel on this callback will stop the upgrade process without rebooting the device. However, a new firmware is not active until a reboot or hard reset has been performed.
Returns
Parameters
currentProgress_pc[in] The current progress of the reboot operation (in percent).
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ onSavingUserSets()

int onSavingUserSets ( int currentProgress_pc,
double timeElapsed_s )

This function will be called when the settings of the device are stored before updating the firmware.

Re-implement this function in a derived class in order to implement a custom behaviour.

This callback will only be called when user sets shall be available after the update. This can be specified by setting the boKeepUserSets flag upon construction of this object.

Returns
Parameters
currentProgress_pc[in] The current progress of the store operation (in percent).
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ onUnzippingFirmwareArchive()

int onUnzippingFirmwareArchive ( int currentProgress_pc,
double timeElapsed_s )

This function will be called once firmware archive (*.mvu) is unzipped to provide the correct firmware file.

Re-implement this function in a derived class in order to implement a custom behaviour.

Returns
Parameters
currentProgress_pc[in] The current progress of the unzip operation (in percent).
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ onUpdatingBootProgrammer()

int onUpdatingBootProgrammer ( int currentProgress_pc,
double timeElapsed_s )

This function will be called once the boot programmer of an mvBlueFOX3 camera is updated.

Re-implement this function in a derived class in order to implement a custom behaviour.

Note
  • Only mvBlueFOX3 cameras require this step so this callback might not be called in case of different device types.
  • BootProgrammer updates won't be necessary often, so this callback will not apply in every firmware update process.
Returns
Parameters
currentProgress_pc[in] The current progress of the update operation (in percent).
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ onUploadingImage()

int onUploadingImage ( int currentProgress_pc,
double timeElapsed_s )

This function will be called once the actual firmware file is uploaded to the device's flash memory.

Re-implement this function in a derived class in order to implement a custom behaviour.

Note
  • Depending on the device type this step might take a few seconds up to a few minutes.
  • The callback will be called several times during the upload.
  • Each time there was a progress of 5 percent this callback will be called.
Returns
Parameters
currentProgress_pc[in] The current progress of the upload operation (in percent).
timeElapsed_s[in] The total time elapsed since starting the update process (in seconds).

◆ setTimeElapsed()

void setTimeElapsed ( double time_s)
protected

◆ statusMessage()

String statusMessage ( )

Returns the current status from the status property.

◆ swigDirectorDisconnect()

void swigDirectorDisconnect ( )
protected

◆ swigRelease()

static long swigRelease ( FirmwareUpdater obj)
staticprotected

◆ swigReleaseOwnership()

void swigReleaseOwnership ( )

◆ swigTakeOwnership()

void swigTakeOwnership ( )

◆ update() [1/3]

int update ( )

A function to start the firmware update process.

This function is intended to be used to update Balluff imaging and image capture devices.

Note
  • Once this function returns, the device will be closed! All objects previously created using the mvIMPACT.acquire.Device pointer must be recreated then.
  • For mvBlueFOX device this function needs to be called without passing any parameters to the function!
Returns

device is part of these multiple devices either mvIMPACT.acquire.DeviceManager.updateDeviceList must be called or every instance to mvIMPACT.acquire.DeviceManager in the current process needs to be destroyed afterwards before any of those GenICam devices can be used again!

◆ update() [2/3]

int update ( String archivePath)

A function to start the firmware update process.

This function is intended to be used to update Balluff imaging and image capture devices.

Note
  • Once this function returns, the device will be closed! All objects previously created using the mvIMPACT.acquire.Device pointer must be recreated then.
  • For mvBlueFOX device this function needs to be called without passing any parameters to the function!
Returns
Parameters
archivePath[in] Path to the file which should be used to update the device. Can be empty if no update archives are needed for the device. device is part of these multiple devices either mvIMPACT.acquire.DeviceManager.updateDeviceList must be called or every instance to mvIMPACT.acquire.DeviceManager in the current process needs to be destroyed afterwards before any of those GenICam devices can be used again!

◆ update() [3/3]

int update ( String archivePath,
boolean boUpdateDataAsNeeded )

A function to start the firmware update process.

This function is intended to be used to update Balluff imaging and image capture devices.

Note
  • Once this function returns, the device will be closed! All objects previously created using the mvIMPACT.acquire.Device pointer must be recreated then.
  • For mvBlueFOX device this function needs to be called without passing any parameters to the function!
Returns
Parameters
archivePath[in] Path to the file which should be used to update the device. Can be empty if no update archives are needed for the device.
boUpdateDataAsNeeded[in] Can be set to false in order to save time when updating multiple devices in one go. Please note that as soon as at least one GenICam device is part of these multiple devices either mvIMPACT.acquire.DeviceManager.updateDeviceList must be called or every instance to mvIMPACT.acquire.DeviceManager in the current process needs to be destroyed afterwards before any of those GenICam devices can be used again!

◆ verifyFirmwareChecksum() [1/2]

static int verifyFirmwareChecksum ( Device pDev,
String archivePath )
static

A function to check the integrity of the firmware running on a device.

This function is intended to be used to check the firmware integrity of Balluff imaging and image capture devices only. Most Balluff imaging and image capture devices are capable of calculating a hash from the firmware image which is currently running on the device. In addition to that firmware archives for imaging devices provided by Balluff contain hashes for all the firmware images contained in the update archive. Comparing these 2 hashes will provide additional security when an application wants to make sure that the firmware running on the device is undamaged.

Note
  • When calling this function, the firmware archive path passed to it must contain the exact same firmware that is running on the device.
  • This feature is currently only available for most Balluff GenICam compliant devices.
  • Once this function returns, the device will be closed! All objects previously created using the mvIMPACT.acquire.Device pointer must be recreated then.
  • If the function returns a negative code of type mvIMPACT.acquire.TDMR_ERROR, the status string will contain a more specific explanation about the root cause for the issue.
Since
2.47.0
Returns
Parameters
pDev[in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object.
archivePath[in] Path to the file which should be used to compare the firmware checksum from with the firmware currently running on the device.

◆ verifyFirmwareChecksum() [2/2]

static int verifyFirmwareChecksum ( Device pDev,
String archivePath,
SWIGTYPE_p_std__string pStatusMessage )
static

A function to check the integrity of the firmware running on a device.

This function is intended to be used to check the firmware integrity of Balluff imaging and image capture devices only. Most Balluff imaging and image capture devices are capable of calculating a hash from the firmware image which is currently running on the device. In addition to that firmware archives for imaging devices provided by Balluff contain hashes for all the firmware images contained in the update archive. Comparing these 2 hashes will provide additional security when an application wants to make sure that the firmware running on the device is undamaged.

Note
  • When calling this function, the firmware archive path passed to it must contain the exact same firmware that is running on the device.
  • This feature is currently only available for most Balluff GenICam compliant devices.
  • Once this function returns, the device will be closed! All objects previously created using the mvIMPACT.acquire.Device pointer must be recreated then.
  • If the function returns a negative code of type mvIMPACT.acquire.TDMR_ERROR, the status string will contain a more specific explanation about the root cause for the issue.
Since
2.47.0
Returns
Parameters
pDev[in] A pointer to a mvIMPACT.acquire.Device object obtained from a mvIMPACT.acquire.DeviceManager object.
archivePath[in] Path to the file which should be used to compare the firmware checksum from with the firmware currently running on the device.
pStatusMessage[out] Pointer to a string receiving additional information about the outcome of the operation. This can be 0 if no one is interested in status information.

Member Data Documentation

◆ swigCMemOwn

transient boolean swigCMemOwn
protected