All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
GENAPI_NAMESPACE::CFirmwareUpdater Class Reference

The CFirmwareUpdater is responsible for running firmware updates. More...

#include <FirmwareUpdater.h>

Public Member Functions

void ApplyUpdate (IFirmwareUpdatableDevice *pDeviceToUpdate, const CFirmwareUpdateInfo &FirmwareUpdateInfo, IFirmwareUpdateProgressObserver *pProgressObserver=NULL, const char *pPreferredLanguageCode=NULL)
 Runs the firmware update process for a device. More...
 
 CFirmwareUpdater ()
 Creates a CFirmwareUpdater object. More...
 
bool FirmwareUpdateMatchesDevice (INodeMap *pNodeMapOfOpenDevice, const CFirmwareUpdateInfo &FirmwareUpdateInfo) const
 Checks if a firmware update represented by FirmwareUpdateInfo can be applied. More...
 
void GetSignatureCheckInfo (const GENICAM_NAMESPACE::gcstring &Filename, size_t &OffsetPackageZipFile, size_t &SizePackageZipFile, size_t &OffsetSignatureFile, size_t &SizeSignatureFile) const
 This method provides information required for running a signature check for a guf file. More...
 
void ReadFirmwareUpdateInfos (const GENICAM_NAMESPACE::gcstring &Filename, IFirmwareUpdateInfoCollector &FirmwareUpdateInfoCollector, const char *pPreferredLanguageCode=NULL) const
 This method provides information required for running a signature check for a guf file. More...
 
void VerifyGufFile (const GENICAM_NAMESPACE::gcstring &Filename)
 Validates a guf file. More...
 
 ~CFirmwareUpdater ()
 Destroys a CFirmwareUpdater object. More...
 

Private Member Functions

 CFirmwareUpdater (const CFirmwareUpdater &)
 
CFirmwareUpdateroperator= (const CFirmwareUpdater &)
 

Private Attributes

CFirmwareUpdaterImpl * m_pImpl
 

Detailed Description

The CFirmwareUpdater is responsible for running firmware updates.

The CFirmwareUpdater class is not thread-safe.

Definition at line 44 of file FirmwareUpdater.h.

Constructor & Destructor Documentation

◆ CFirmwareUpdater() [1/2]

GENAPI_NAMESPACE::CFirmwareUpdater::CFirmwareUpdater ( )

Creates a CFirmwareUpdater object.

Does not throw C++ exceptions, except when memory allocation fails.

◆ ~CFirmwareUpdater()

GENAPI_NAMESPACE::CFirmwareUpdater::~CFirmwareUpdater ( )

Destroys a CFirmwareUpdater object.

Does not throw C++ exceptions.

◆ CFirmwareUpdater() [2/2]

GENAPI_NAMESPACE::CFirmwareUpdater::CFirmwareUpdater ( const CFirmwareUpdater )
private

Member Function Documentation

◆ ApplyUpdate()

void GENAPI_NAMESPACE::CFirmwareUpdater::ApplyUpdate ( IFirmwareUpdatableDevice pDeviceToUpdate,
const CFirmwareUpdateInfo FirmwareUpdateInfo,
IFirmwareUpdateProgressObserver pProgressObserver = NULL,
const char *  pPreferredLanguageCode = NULL 
)

Runs the firmware update process for a device.

Parameters
[in]pDeviceToUpdateThe device to update wrapped by an object implementing IFirmwareUpdatableDevice.
[in]FirmwareUpdateInfoThe firmware update info object representing a firmware update to apply.
[in]pProgressObserverA progress listener implementing pProgressObserver.
[in]pPreferredLanguageCodeThe preferred ISO 639-1 language code. Falls back, if not available, to: first "en", then no language code, then the first found entry.

Double checks if the device can be updated by firmware update info. Can update another device after failure.

Throws a FileNotFoundException if the guf file with specified by FirmwareUpdateInfo cannot be found. Throws a FileIOException if reading the guf file fails. Throws a RuntimeException if the guf file has been tampered with since reading UpdateInfos or if the loading of a user set backup to the node map fails. Throws an InvalidArgumentException if pDeviceToUpdate is NULL or the FirmwareUpdateInfo does not match the device. Throws C++ exceptions if accessing the device fails.

◆ FirmwareUpdateMatchesDevice()

bool GENAPI_NAMESPACE::CFirmwareUpdater::FirmwareUpdateMatchesDevice ( INodeMap pNodeMapOfOpenDevice,
const CFirmwareUpdateInfo FirmwareUpdateInfo 
) const

Checks if a firmware update represented by FirmwareUpdateInfo can be applied.

Parameters
[in]pNodeMapOfOpenDeviceThe node map of an open device.
[in]FirmwareUpdateInfoA firmware update info object representing a firmware update.
Returns
Returns true if the firmware update can be applied. Returns false if the firmware update object is not valid.

Throws an InvalidArgumentException if pNodeMapOfOpenDevice is NULL.

◆ GetSignatureCheckInfo()

void GENAPI_NAMESPACE::CFirmwareUpdater::GetSignatureCheckInfo ( const GENICAM_NAMESPACE::gcstring Filename,
size_t &  OffsetPackageZipFile,
size_t &  SizePackageZipFile,
size_t &  OffsetSignatureFile,
size_t &  SizeSignatureFile 
) const

This method provides information required for running a signature check for a guf file.

Parameters
[in]FilenameThe path and name of the guf file.
[out]OffsetPackageZipFileThe offset of the package.zip file in the guf file container.
[out]SizePackageZipFileThe size of the package.zip file in the guf file container.
[out]OffsetSignatureFileThe offset of the package.p7s file in the guf file container. Can be 0 if there is no signature available.
[out]SizeSignatureFileThe size of the package.p7s file in the guf file container. Can be 0 if there is no signature available.

Throws a FileNotFoundException if the file with name Filename cannot be found. Throws a FileIOException if reading the file fails. Throws a FormatException if the file is not of GUF format, e.g. is compressed, mandatory info entries are missing etc. Throws a BadAllocException if memory allocation fails.

◆ operator=()

CFirmwareUpdater& GENAPI_NAMESPACE::CFirmwareUpdater::operator= ( const CFirmwareUpdater )
private

◆ ReadFirmwareUpdateInfos()

void GENAPI_NAMESPACE::CFirmwareUpdater::ReadFirmwareUpdateInfos ( const GENICAM_NAMESPACE::gcstring Filename,
IFirmwareUpdateInfoCollector FirmwareUpdateInfoCollector,
const char *  pPreferredLanguageCode = NULL 
) const

This method provides information required for running a signature check for a guf file.

Parameters
[in]FilenameThe path and name of the guf file.
[in]FirmwareUpdateInfoCollectorAn object receiving a callback each time an update is found in a guf file.
[in]pPreferredLanguageCodeThe preferred ISO 639-1 language code. Falls back, if not available, to: first "en", then no language code, then the first found entry.

Throws a FileNotFoundException if the file with name Filename cannot be found. Throws a FileIOException if reading the file fails. Throws a FormatException if the file is not of GUF format, e.g. is compressed, mandatory info entries are missing etc. Throws a BadAllocException if memory allocation fails.

◆ VerifyGufFile()

void GENAPI_NAMESPACE::CFirmwareUpdater::VerifyGufFile ( const GENICAM_NAMESPACE::gcstring Filename)

Validates a guf file.

Parameters
[in]FilenameThe path and name of the guf file.
Note
Unused files ore procedures that are part of the guf file are currently tolerated.

Throws a FileNotFoundException if a required file cannot be found. Throws a FileIOException when there was an error during extraction. Throws a FormatException when mandatory information is missing. Throws a RuntimeException when the XML data is malformed.

Member Data Documentation

◆ m_pImpl

CFirmwareUpdaterImpl* GENAPI_NAMESPACE::CFirmwareUpdater::m_pImpl
private

Definition at line 160 of file FirmwareUpdater.h.


The documentation for this class was generated from the following file:


rc_genicam_api
Author(s): Heiko Hirschmueller
autogenerated on Wed Dec 4 2024 03:10:12