Impact Acquire SDK .NET
FirmwareUpdate.cs

The FirmwareUpdate program is a simple example which illustrates how Balluff/MATRIX VISION cameras can be easily updated using the Impact Acquire API.

Since
2.49.0
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
Program location
The source file FirmwareUpdate.cpp can be found under:
%INSTALLDIR%\apps\FirmwareUpdate\
Note
If you have installed the package without example applications, this file will not be available. On Windows® the sample application can be installed or removed from the target system at any time by simply restarting the installation package.
How it works:
  1. Let the user decide which devices to use.
  2. Figure out which exact device is selected for the update.
  3. Create a MyFirmwareUpdater object, derived from FirmwareUpdater class
  4. Override the status callbacks to create status messages at stdout
  5. Start the firmware update and check the result.
Note
If some kind of status of the update progress is required (e.g. to display the update progress on a GUI, etc.) it will be necessary to create an object which derives from mv.impact.acquire.FirmwareUpdater and to override the virtual callbacks. More details explanation the functionalities of the FirmwareUpdater API can be found at mv.impact.acquire.FirmwareUpdater.
Console Output
The camera's firmware is the same as the version being used here.
[0]: BF003939 (mvBlueFOX-223C, mvBlueFOX, interface layout: DeviceSpecific, acquisition start/stop behaviour: Default)
[1]: BN000110 (BVS CA-BN2-0016ZC, BVS CA-BN (mvBlueNAOS), interface layout: GenICam, acquisition start/stop behaviour: User)
[2]: FF001403 (mvBlueFOX3-2004C, mvBlueFOX3, interface layout: GenICam, acquisition start/stop behaviour: User)
[3]: GX000020 (mvBlueCOUGAR-X102dC, mvBlueCOUGAR, interface layout: GenICam, acquisition start/stop behaviour: User)
[4]: GX022189 (mvBlueCOUGAR-X100fC, mvBlueCOUGAR, interface layout: GenICam, acquisition start/stop behaviour: User)

Please enter the number in front of the listed device followed by [ENTER] to open it:

Once the device has been selected, the update process will be started. Depending on the selected device and parameters the console output might and the duration might differ.

Updating GX022189...
Unzipping firmware archive - Update progress: 5, time 0.000000 s
Uploading - Update progress: 25, time 0.501117 s
Uploading - Update progress: 30, time 12.265582 s
Uploading - Update progress: 35, time 24.396343 s
Uploading - Update progress: 40, time 36.197152 s
Uploading - Update progress: 45, time 48.613364 s
Uploading - Update progress: 50, time 61.444290 s
Uploading - Update progress: 55, time 73.644665 s
Uploading - Update progress: 60, time 85.647717 s
Uploading - Update progress: 65, time 97.328879 s
Uploading - Update progress: 70, time 109.088660 s
Uploading - Update progress: 75, time 120.990581 s
Uploading - Update progress: 80, time 132.533798 s
Rebooting - Update progress: 86, time 161.574359 s
Rebooting - Update progress: 90, time 164.087728 s
Result code after updating: 0
Press [ENTER] to end the application

If desired, this sample can also be used as a command line tool to update Balluff/MATRIX VISION devices. The following command line parameters might be useful in this case.

Parameter Functionality
General
serial Allows the user to specify the serial number of a specific device which should be used by the application.
unattended Will avoid to ask for user interactions, if possible.
force Will force the update even if FW is already up-to-date.
help Will display a help text in the console.
mvBlueCOUGAR-(X/XD/XT) and mvBlueFOX3
forceDowngrade Will force an update even if the specified FW is older than the version already installed on the selected device.
keepUserSets If UserSets are stored on the device the should still be present after the update. Otherwise they will be deleted.
forceBreakingChange Will update the device even if the interface might be different afterwards.
pathToFWArchive Path to the firmware archive which should be used to update the device. (required)
mvBlueFOX
version The version that should be used to update the device. For more details please refer to mv.impact.acquire.FirmwareUpdater.firmwareVersionToUpload
How it works

The update process itself is very straight forward. It is just necessary to create an instance of mv.impact.acquire.FirmwareUpdater. To configure the update process itself it is necessary to pass the correct parameters to the constructor. Afterwards it is sufficient to call mvIMPACT.acquire.FirmwareUpdater.update.

Every setting which is meant to be configurable for the update process can be changed within the constructor or, in case of mvBlueFOX devices within the mv.impact.acquire.FirmwareUpdater.firmwareVersionToUpload property.

Attention
  • Do not unplug the device during the update procedure!
  • Once the firmwareUpdate method call returns an error call the mv.impact.acquire.FirmwareUpdater.statusMessage function. It will return useful information about the current status (including issues) of the update procedure.
  • The actual mv.impact.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!

The callbacks can be customized to get the required behavior. In this example the update status callbacks just return some message to the shell and look like this:

public class MyFirmwareUpdater : mv.impact.acquire.FirmwareUpdater
{
public MyFirmwareUpdater(Device pDev, bool boOverride=true, bool boForceDowngrade=true, bool boKeepUserSets=true, bool boForceBreakingChange=true) : base(pDev, boOverride, boForceDowngrade, boKeepUserSets, boForceBreakingChange) { }
public override int onErrorMessage(double progressTimer)
{
Console.WriteLine("Info: {0} @ {1} s", statusMessage, progressTimer);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onErasingFlash(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Erasing - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onUnzippingFirmwareArchive(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Unzipping firmware archive - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onUpdatingBootProgrammer(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Updating boot programmer - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onUploadingImage(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Uploading - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onRebooting(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Rebooting - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onHardResetRequired(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Rebooting - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
Console.WriteLine("Manual hard reset required.");
return (int)TFirmwareUpdateAction.fuaCancel;
}
public override int onSavingUserSets(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Saving sets - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onLoadingUserSets(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Loading sets - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
}
Definition Enumerations.cs:2
Updating mvBlueFOX3 or mvBlueCOUGAR-X/XD/XT devices

For mvBlueFOX3 or mvBlueCOUGAR-X/XD/XT devices it is necessary to provide the path to a firmware archive (*.mvu file). Some cases might require some specific parameters to be changed e.g. in case of downgrading a device or if there might be a breaking change within the device's software interface.

Note
Downloads to Balluff firmware files can be found at the Balluff website.
static TDMR_ERROR updateBlueCOUGAROrBlueFOX3(Device pDev, string pathToFirmwareArchive, bool boForceOverideSameVersion, bool boForceDowngrade, bool boForceSameVersion, bool boForceBreakingChange, out string status)
{
status = "";
TDMR_ERROR result = TDMR_ERROR.DMR_NO_ERROR;
MyFirmwareUpdater fwu = new MyFirmwareUpdater(pDev, boForceOverideSameVersion, boForceDowngrade, boForceSameVersion, boForceBreakingChange);
result = fwu.update(pathToFirmwareArchive);
if(result == TDMR_ERROR.DMR_NO_ERROR)
{
result = MyFirmwareUpdater.verifyFirmwareChecksum(pDev, pathToFirmwareArchive);
if(result != TDMR_ERROR.DMR_NO_ERROR)
{
Console.WriteLine("Firmware checksum verification: {0}", fwu.statusMessage);
}
else
{
Console.WriteLine("Firmware checksum verified successful!");
}
}
if(result != TDMR_ERROR.DMR_NO_ERROR )
{
status = fwu.statusMessage;
}
return result;
}
Updating BVS CA-BN (mvBlueNAOS) devices

As BVS CA-BN (mvBlueNAOS) devices are very much integrated within the host system, there is no separate firmware file which can be downloaded. The devices firmware is embedded into the Impact Acquire framework and has to be updated once the Impact Acquire framework on the host system contains breaking changes. This applies for upgrades as well as for downgrades.

static TDMR_ERROR updateBVS_CA_BN(Device pDev, bool boForce, out string status )
{
status = null;
string latestFirmwareVersion;
if(GetLatestLocalFirmwareVersion(pDev, out latestFirmwareVersion))
{
if( !boForce )
{
Console.WriteLine("Skipping device {0} because it already uses the current FW version ({1}).", pDev.serial.read(), pDev.firmwareVersion.readS());
return TDMR_ERROR.DMR_NO_ERROR;
}
else
{
Console.WriteLine("Device {0} already uses the current FW version ({1}).", pDev.serial.read(), pDev.firmwareVersion.readS());
Console.WriteLine("Not skipping because 'force' specified'.");
}
}
Console.WriteLine("Updating device {0} from FW version {1} to {2}.", pDev.serial.read(), pDev.firmwareVersion.readS(), latestFirmwareVersion);
TDMR_ERROR result = TDMR_ERROR.DMR_NO_ERROR;
MyFirmwareUpdater fwu = new MyFirmwareUpdater(pDev);
result = fwu.update();
if(result != TDMR_ERROR.DMR_NO_ERROR)
{
status = fwu.statusMessage;
}
return result;
}
Updating mvBlueFOX devices

As mvBlueFOX devices are not capable of the complex functionalities provided by GenICam™ compliant devices the set of configurable parameters is much more limited. There is no specific firmware file available, instead different firmware versions are shipped within the mvBlueFOX package and can be selected for the update via the mv.impact.acquire.FirmwareUpdater.firmwareVersionToUpload property.

static TDMR_ERROR updateBlueFOX(Device pDev, string version, out string status)
{
status = null;
TDMR_ERROR result = TDMR_ERROR.DMR_NO_ERROR;
MyFirmwareUpdater fwu = new MyFirmwareUpdater(pDev);
if( version != null && fwu.firmwareVersionToUpload.isValid)
{
// use specific version if specified
fwu.firmwareVersionToUpload.writeS(version);
}
Console.WriteLine("Updating device {0} from FW version {1} to {2}.", pDev.serial.read(), pDev.firmwareVersion.readS(), fwu.firmwareVersionToUpload.readS());
result = fwu.update();
if(result != TDMR_ERROR.DMR_NO_ERROR)
{
status = fwu.statusMessage;
}
return result;
}
Source code
using System;
using mv.impact.acquire.examples.helper;
namespace mv.impact.acquire.examples
{
class MyFirmwareUpdater : mv.impact.acquire.FirmwareUpdater
{
public MyFirmwareUpdater(Device pDev, bool boOverride = true, bool boForceDowngrade = true, bool boKeepUserSets = true, bool boForceBreakingChange = true) : base(pDev, boOverride, boForceDowngrade, boKeepUserSets, boForceBreakingChange) { }
public override int onErrorMessage(double progressTimer)
{
Console.WriteLine("Info: {0} @ {1} s", statusMessage, progressTimer);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onErasingFlash(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Erasing - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onUnzippingFirmwareArchive(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Unzipping firmware archive - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onUpdatingBootProgrammer(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Updating boot programmer - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onUploadingImage(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Uploading - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onRebooting(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Rebooting - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onHardResetRequired(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Rebooting - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
Console.WriteLine("Manual hard reset required.");
return (int)TFirmwareUpdateAction.fuaCancel;
}
public override int onSavingUserSets(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Saving sets - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
public override int onLoadingUserSets(int currentProgress_pc, double timeElapsed)
{
Console.WriteLine("Loading sets - Update progress: {0}, time: {1:N2} s", currentProgress_pc, timeElapsed);
return (int)TFirmwareUpdateAction.fuaContinue;
}
}
class FirmwareUpdate
{
enum TDeviceFamily
{
dfBVS_CA_BN,
dfMvBlueCOUGAR,
dfMvBlueFOX3,
dfMvBlueFOX,
dfUnknown
};
static bool IsGigEVisionDevice(Device pDev)
{
PropertyI64 deviceIPAddress = new PropertyI64();
DeviceComponentLocator locator = new DeviceComponentLocator(pDev.hDev);
return (locator.bindComponent(deviceIPAddress, "DeviceIPAddress") && (deviceIPAddress.readS() != "Unavailable"));
}
static TDeviceFamily GetDeviceFamily(Device pDev)
{
if ((pDev.family.readS() == "mvBlueCOUGAR" || pDev.family.readS() == "BVS CA") && IsGigEVisionDevice(pDev))
{
return TDeviceFamily.dfMvBlueCOUGAR;
}
if (pDev.family.readS() == "mvBlueFOX3" || pDev.family.readS() == "BVS CA")
{
return TDeviceFamily.dfMvBlueFOX3;
}
if (pDev.product.read().StartsWith("BVS CA-BN") || (pDev.family.read() == "mvBlueNAOS"))
{
return TDeviceFamily.dfBVS_CA_BN;
}
if (pDev.family.readS() == "mvBlueFOX")
{
return TDeviceFamily.dfMvBlueFOX;
}
return TDeviceFamily.dfUnknown;
}
static bool GetLatestLocalFirmwareVersion(Device pDev, out string latestFirmwareVersion)
{
latestFirmwareVersion = "0.0.0.0";
string currentFirmwareVersion = pDev.firmwareVersion.readS();
PropertyI64 firmwareVersionLatest = new PropertyI64();
DeviceComponentLocator locator = new DeviceComponentLocator(pDev.hDev);
if (!locator.bindComponent(firmwareVersionLatest, "FirmwareVersionLatest"))
{
return false;
}
latestFirmwareVersion = firmwareVersionLatest.readS();
return (currentFirmwareVersion == latestFirmwareVersion);
}
static TDMR_ERROR updateBlueCOUGAROrBlueFOX3(Device pDev, string pathToFirmwareArchive, bool boForceOverideSameVersion, bool boForceDowngrade, bool boForceSameVersion, bool boForceBreakingChange, out string status)
{
status = "";
TDMR_ERROR result = TDMR_ERROR.DMR_NO_ERROR;
MyFirmwareUpdater fwu = new MyFirmwareUpdater(pDev, boForceOverideSameVersion, boForceDowngrade, boForceSameVersion, boForceBreakingChange);
result = fwu.update(pathToFirmwareArchive);
if (result == TDMR_ERROR.DMR_NO_ERROR)
{
result = MyFirmwareUpdater.verifyFirmwareChecksum(pDev, pathToFirmwareArchive);
if (result != TDMR_ERROR.DMR_NO_ERROR)
{
Console.WriteLine("Firmware checksum verification: {0}", fwu.statusMessage);
}
else
{
Console.WriteLine("Firmware checksum verified successful!");
}
}
if (result != TDMR_ERROR.DMR_NO_ERROR)
{
status = fwu.statusMessage;
}
return result;
}
static TDMR_ERROR updateBlueFOX(Device pDev, string version, out string status)
{
status = null;
TDMR_ERROR result = TDMR_ERROR.DMR_NO_ERROR;
MyFirmwareUpdater fwu = new MyFirmwareUpdater(pDev);
if (version != null && fwu.firmwareVersionToUpload.isValid)
{
// use specific version if specified
fwu.firmwareVersionToUpload.writeS(version);
}
Console.WriteLine("Updating device {0} from FW version {1} to {2}.", pDev.serial.read(), pDev.firmwareVersion.readS(), fwu.firmwareVersionToUpload.readS());
result = fwu.update();
if (result != TDMR_ERROR.DMR_NO_ERROR)
{
status = fwu.statusMessage;
}
return result;
}
static TDMR_ERROR updateBVS_CA_BN(Device pDev, bool boForce, out string status)
{
status = null;
string latestFirmwareVersion;
if (GetLatestLocalFirmwareVersion(pDev, out latestFirmwareVersion))
{
if (!boForce)
{
Console.WriteLine("Skipping device {0} because it already uses the current FW version ({1}).", pDev.serial.read(), pDev.firmwareVersion.readS());
return TDMR_ERROR.DMR_NO_ERROR;
}
Console.WriteLine("Device {0} already uses the current FW version ({1}).", pDev.serial.read(), pDev.firmwareVersion.readS());
Console.WriteLine("Not skipping because 'force' specified'.");
}
Console.WriteLine("Updating device {0} from FW version {1} to {2}.", pDev.serial.read(), pDev.firmwareVersion.readS(), latestFirmwareVersion);
TDMR_ERROR result = TDMR_ERROR.DMR_NO_ERROR;
MyFirmwareUpdater fwu = new MyFirmwareUpdater(pDev);
result = fwu.update();
if (result != TDMR_ERROR.DMR_NO_ERROR)
{
status = fwu.statusMessage;
}
return result;
}
// This function will allow to select devices that support the Firmware API
// as the code of the example relies on these feature in the code.
static bool isDeviceSupportedBySample(Device pDev)
{
return GetDeviceFamily(pDev) != TDeviceFamily.dfUnknown;
}
static void displayCommandLineOptions()
{
Console.WriteLine("Available command line parameters:");
Console.WriteLine(" General:");
Console.WriteLine(" 'serial' or 's' to specify the serial number of the device to use (if not specified the user will be asked to select a device)");
Console.WriteLine(" 'unattended' or 'u' to specify no questions asked, if possible");
Console.WriteLine(" 'force' or 'f' to specify force update even if FW is already up-to-date");
Console.WriteLine(" 'help' or 'h' displays this help text");
Console.WriteLine(" mvBlueCOUGAR-(X/XD/XT) and mvBlueFOX3:");
Console.WriteLine(" 'forceDowngrade' or 'd' to force an update even if the specified FW is older than the version already installed");
Console.WriteLine(" 'keepUserSets' or 'k' if UserSets stored on the device should still be present after the update");
Console.WriteLine(" 'forceBreakingChange' or 'b' if the device should be updated even if the interface might be different afterwards");
Console.WriteLine(" 'pathToFWArchive' or 'p' to specify the firmware archive which should be used to update the device");
Console.WriteLine(" mvBlueFOX:");
Console.WriteLine(" 'version' or 'v' to specify the version that should be used to update the device");
Console.WriteLine();
Console.WriteLine("USAGE EXAMPLES:");
Console.WriteLine(" FirmwareUpdate s=BN* f=1");
Console.WriteLine(" FirmwareUpdate s=GX* p=\"path to firmware archive\" k=0");
Console.WriteLine(" FirmwareUpdate s=BF* v=49");
}
static int Main(string[] args)
{
mv.impact.acquire.LibraryPath.init(); // this will add the folders containing unmanaged libraries to the PATH variable.
bool boUnattended = false;
bool boForceSameVersion = false;
bool boForceDowngrade = false;
bool boKeepUserSets = true;
bool boForceBreakingChange = false;
string version = null;
string pathToFirmwareArchive = null;
Device pDev = null;
if (args.Length > 0)
{
bool boInvalidCommandLineParameterDetected = false;
foreach (var arg in args)
{
string[] argumentParts = arg.Split('=');
switch (argumentParts[0])
{
case "s":
case "serial":
pDev = DeviceManager.getDeviceBySerial(argumentParts[1]);
break;
case "u":
case "unattended":
boUnattended = Convert.ToBoolean(Convert.ToInt32(argumentParts[1]));
break;
case "f":
case "force":
boForceSameVersion = Convert.ToBoolean(Convert.ToInt32(argumentParts[1]));
break;
case "h":
case "help":
displayCommandLineOptions();
break;
case "d":
case "forceDowngrade":
boForceDowngrade = Convert.ToBoolean(Convert.ToInt32(argumentParts[1]));
break;
case "k":
case "keepUserSets":
boKeepUserSets = Convert.ToBoolean(Convert.ToInt32(argumentParts[1]));
break;
case "b":
case "forceBreakingChange":
boForceBreakingChange = Convert.ToBoolean(Convert.ToInt32(argumentParts[1]));
break;
case "p":
case "pathToFWArchive":
pathToFirmwareArchive = argumentParts[1];
break;
case "v":
case "version":
version = argumentParts[1];
break;
default:
boInvalidCommandLineParameterDetected = true;
break;
}
}
if (boInvalidCommandLineParameterDetected)
{
displayCommandLineOptions();
}
}
else
{
Console.WriteLine("No command line parameters specified.");
displayCommandLineOptions();
Console.Read();
}
if (pDev == null)
{
pDev = DeviceAccess.getDeviceFromUserInput();
if (isDeviceSupportedBySample(pDev))
{
Console.WriteLine("Error! Device not supported by this sample. Unable to continue!");
if (!boUnattended)
{
Console.WriteLine("Press [ENTER] to end the application");
Console.Read();
}
Environment.Exit(1);
}
}
if (pDev == null)
{
Console.WriteLine("Unable to continue!");
return 1;
}
TDeviceFamily deviceFamily = GetDeviceFamily(pDev);
if (deviceFamily == TDeviceFamily.dfUnknown)
{
Console.WriteLine("The selected device is not supported by this sample. Unable to continue!");
if (!boUnattended)
{
Console.WriteLine("Press [ENTER] to end the application");
Console.Read();
}
return 1;
}
if (!boUnattended)
{
Console.WriteLine("Press [ENTER] to update the device.");
Console.Read();
}
Console.WriteLine("Updating {0} ...", pDev.serial.read());
string status = "";
TDMR_ERROR updateResult = TDMR_ERROR.DMR_NO_ERROR;
try
{
switch (deviceFamily)
{
case TDeviceFamily.dfMvBlueCOUGAR:
case TDeviceFamily.dfMvBlueFOX3:
updateResult = updateBlueCOUGAROrBlueFOX3(pDev, pathToFirmwareArchive, boForceSameVersion, boForceDowngrade, boKeepUserSets, boForceBreakingChange, out status);
break;
case TDeviceFamily.dfMvBlueFOX:
updateResult = updateBlueFOX(pDev, version, out status);
break;
case TDeviceFamily.dfBVS_CA_BN:
updateResult = updateBVS_CA_BN(pDev, boForceSameVersion, out status);
break;
}
}
catch (ImpactAcquireException e)
{
Console.WriteLine("An error occurred while updating the firmware of the device {0} (error code: {1}).", pDev.serial.read(), e.errorCodeAsString);
// reading out potential issues
Console.WriteLine("Status: {0}", status);
}
Console.WriteLine("Result code after updating: {0}({1})", updateResult, ImpactAcquireException.getErrorCodeAsString(updateResult));
// update device list explicitly otherwise it contains illegal pointers to the "old" device (BVS CA-BN)
DeviceManager.updateDeviceList();
if (!boUnattended)
{
Console.WriteLine("Press [ENTER] to end the application");
Console.Read();
}
return updateResult == TDMR_ERROR.DMR_NO_ERROR ? 0 : 1;
}
}
}
A small helper class to administer various library search path related variables and paths.
Definition LibraryPath.cs:14
static void init()
Calling this method will add the folders containing unmanaged libraries to the systems library search...
Definition LibraryPath.cs:251
This namespace contains classes and functions belonging to the image acquisition module of this SDK.
Definition Enumerations.cs:2
Definition Enumerations.cs:2