CVB++ 14.1
FWUpdater Class Reference

Firmware updater class. More...

#include <cvb/genapi/fw_updater.hpp>

Public Member Functions

 FWUpdater (const String &filename, bool verify=true)
 Construct a firmware updater, Validate a guf file and set the location of the guf file as CVB::String. More...
 
void * Handle () const noexcept
 Classic API node map handle. More...
 
size_t UpdateFileCount ()
 Gets the number of available update files in a guf file. More...
 
size_t UpdateFileInfoCount (const size_t &fileIndex)
 Gets the number of available update infos in a guf file. More...
 
String UpdateFileInfo (size_t fileIndex, size_t infoIndex, FirmwareUpdateInfo cmd)
 Identifies a single firmware update and gets information about the firmware update as CVB::String. More...
 
std::vector< std::pair< String, String > > AvailableGufInfo ()
 Collects all key value pairs available in a guf file. More...
 
std::vector< StringAvailableUpdateFiles ()
 Collects all mandatory update file infos available in a guf file. More...
 
std::vector< StringUpdateFileInfos (const size_t &updateFileIndex)
 Collects all information on a single update file available in a guf file. More...
 
void Update (DevicePtr &&device, const size_t updateFileSelection)
 Update the device. More...
 

Static Public Member Functions

static std::unique_ptr< FWUpdaterCreate (const String &filename, bool verify=true)
 Create a firmware updater, Validate a guf file and set the location of the guf file as CVB::String. More...
 
static std::unique_ptr< FWUpdaterFromHandle (HandleGuard< FWUpdater > &&guard, const String &filename)
 Creates a firmware updater from a classic API handle. More...
 

Detailed Description

Firmware updater class.

Example

Constructor & Destructor Documentation

◆ FWUpdater()

FWUpdater ( const String filename,
bool  verify = true 
)
inlineexplicit

Construct a firmware updater, Validate a guf file and set the location of the guf file as CVB::String.

Note
Unused files or procedures that are part of the guf file are currently tolerated.
Parameters
[in]filenamePath and name of the guf file to be applied to the camera.
[in]verifyIf true the guf file will be validated.
Exceptions
Anyexception derived from std::exception including CvbException.

Member Function Documentation

◆ AvailableGufInfo()

std::vector< std::pair< String, String > > AvailableGufInfo ( )
inline

Collects all key value pairs available in a guf file.

Returns
std::map with key value pair.

◆ AvailableUpdateFiles()

std::vector< String > AvailableUpdateFiles ( )
inline

Collects all mandatory update file infos available in a guf file.

Returns
std::vector<String> with update file description and version.

◆ Create()

std::unique_ptr< FWUpdater > Create ( const String filename,
bool  verify = true 
)
inlinestatic

Create a firmware updater, Validate a guf file and set the location of the guf file as CVB::String.

Note
Unused files or procedures that are part of the guf file are currently tolerated.
Parameters
[in]filenamePath and name of the guf file to be applied to the camera.
[in]verifyIf true the guf file will be validated.
Returns
A pointer to the firmware updater
Exceptions
Anyexception derived from std::exception including CvbException.

◆ FromHandle()

std::unique_ptr< FWUpdater > FromHandle ( HandleGuard< FWUpdater > &&  guard,
const String filename 
)
inlinestatic

Creates a firmware updater from a classic API handle.

Parameters
[in]guardLife time guard for C-API handle.
[in]filenamename of the updater guf file.
Returns
The firmware updater created from the classic API handle.
Exceptions
Anyexception derived from std::exception including CvbException.

The firmware updater takes ownership of the handle, so you must share it before using this function.

◆ Handle()

void * Handle ( ) const
inlinenoexcept

Classic API node map handle.

Returns
Classic API handle.
Exceptions
Doesnot throw any exception.

It is normally not necessary to work with this handle.

◆ Update()

void Update ( DevicePtr &&  device,
const size_t  updateFileSelection 
)
inline

Update the device.

Parameters
[in]deviceDevice to update.
[in]updateFileSelectionIndex of guf file update to apply to device.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ UpdateFileCount()

size_t UpdateFileCount ( )
inline

Gets the number of available update files in a guf file.

Returns
Number of available firmware update files in the guf file.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ UpdateFileInfo()

String UpdateFileInfo ( size_t  fileIndex,
size_t  infoIndex,
FirmwareUpdateInfo  cmd 
)
inline

Identifies a single firmware update and gets information about the firmware update as CVB::String.

Parameters
[in]fileIndexIndex of update file within guf file.
[in]infoIndexIndex of information within update file.
[in]cmdCommand to identify the information to be retrieved.
Returns
Info string with requested information.

◆ UpdateFileInfoCount()

size_t UpdateFileInfoCount ( const size_t &  fileIndex)
inline

Gets the number of available update infos in a guf file.

Parameters
[in]fileIndexIndex of update file within guf to read infos from.
Returns
Number of available firmware update infos.
Exceptions
Anyexception derived from std::exception including CvbException.

◆ UpdateFileInfos()

std::vector< String > UpdateFileInfos ( const size_t &  updateFileIndex)
inline

Collects all information on a single update file available in a guf file.

Returns
std::vector<String> with update file description and version.