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 &) | |
CFirmwareUpdater & | operator= (const CFirmwareUpdater &) |
Private Attributes | |
CFirmwareUpdaterImpl * | m_pImpl |
The CFirmwareUpdater is responsible for running firmware updates.
The CFirmwareUpdater class is not thread-safe.
Definition at line 44 of file FirmwareUpdater.h.
GENAPI_NAMESPACE::CFirmwareUpdater::CFirmwareUpdater | ( | ) |
Creates a CFirmwareUpdater object.
Does not throw C++ exceptions, except when memory allocation fails.
GENAPI_NAMESPACE::CFirmwareUpdater::~CFirmwareUpdater | ( | ) |
Destroys a CFirmwareUpdater object.
Does not throw C++ exceptions.
|
private |
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.
[in] | pDeviceToUpdate | The device to update wrapped by an object implementing IFirmwareUpdatableDevice. |
[in] | FirmwareUpdateInfo | The firmware update info object representing a firmware update to apply. |
[in] | pProgressObserver | A progress listener implementing pProgressObserver. |
[in] | pPreferredLanguageCode | The 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.
bool GENAPI_NAMESPACE::CFirmwareUpdater::FirmwareUpdateMatchesDevice | ( | INodeMap * | pNodeMapOfOpenDevice, |
const CFirmwareUpdateInfo & | FirmwareUpdateInfo | ||
) | const |
Checks if a firmware update represented by FirmwareUpdateInfo
can be applied.
[in] | pNodeMapOfOpenDevice | The node map of an open device. |
[in] | FirmwareUpdateInfo | A firmware update info object representing a firmware update. |
Throws an InvalidArgumentException if pNodeMapOfOpenDevice
is NULL.
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.
[in] | Filename | The path and name of the guf file. |
[out] | OffsetPackageZipFile | The offset of the package.zip file in the guf file container. |
[out] | SizePackageZipFile | The size of the package.zip file in the guf file container. |
[out] | OffsetSignatureFile | The offset of the package.p7s file in the guf file container. Can be 0 if there is no signature available. |
[out] | SizeSignatureFile | The 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.
|
private |
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.
[in] | Filename | The path and name of the guf file. |
[in] | FirmwareUpdateInfoCollector | An object receiving a callback each time an update is found in a guf file. |
[in] | pPreferredLanguageCode | The 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.
void GENAPI_NAMESPACE::CFirmwareUpdater::VerifyGufFile | ( | const GENICAM_NAMESPACE::gcstring & | Filename | ) |
Validates a guf file.
[in] | Filename | The path and name of the guf file. |
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.
|
private |
Definition at line 160 of file FirmwareUpdater.h.