IDS peak genericC++  v1.5.0
peak::core::FirmwareUpdater Class Referencefinal

Allows to update the firmware of a device. More...

#include <peak/device/peak_firmware_updater.hpp>

Public Member Functions

 FirmwareUpdater ()
 
 ~FirmwareUpdater ()
 
 FirmwareUpdater (const FirmwareUpdater &other)=delete
 
FirmwareUpdater & operator= (const FirmwareUpdater &other)=delete
 
 FirmwareUpdater (FirmwareUpdater &&other)=delete
 
FirmwareUpdater & operator= (FirmwareUpdater &&other)=delete
 
std::vector< std::shared_ptr< FirmwareUpdateInformation > > CollectFirmwareUpdateInformation (const std::string &gufPath) const
 Collects all firmware update information of a given *.guf file. More...
 
std::vector< std::shared_ptr< FirmwareUpdateInformation > > CollectFirmwareUpdateInformation (const std::string &gufPath, const std::shared_ptr< DeviceDescriptor > &device) const
 Collects the firmware update information of a given *.guf file fitting to a given device. More...
 
void UpdateDevice (const std::shared_ptr< DeviceDescriptor > &device, const std::shared_ptr< FirmwareUpdateInformation > &updateInformation, const FirmwareUpdateProgressObserver *progressObserver=nullptr, Timeout deviceResetDiscoveryTimeout=Timeout(60000ms))
 Updates a given device by using a given firmware update information. More...
 

Detailed Description

Allows to update the firmware of a device.

To update the device firmware, call CollectFirmwareUpdateInformation() with a *.guf file and the device to update, select one of the firmware updates in the list, then pass it to UpdateDevice() to exectue the update.

To observe the update progress, pass a FirmwareUpdateProgressObserver to the UpdateDevice(). This is optional, but very helpful, since firmware updates can take several minutes.

Note
The DeviceDescriptor passed to CollectFirmwareUpdateInformation() and UpdateDevice() will be opened in Exclusive mode. Therefore, if the Device is opened in any other application, both methods will fail with an InternalErrorException.

Constructor & Destructor Documentation

◆ FirmwareUpdater() [1/3]

peak::core::FirmwareUpdater::FirmwareUpdater ( )
inline

◆ ~FirmwareUpdater()

peak::core::FirmwareUpdater::~FirmwareUpdater ( )
inline

◆ FirmwareUpdater() [2/3]

peak::core::FirmwareUpdater::FirmwareUpdater ( const FirmwareUpdater &  other)
delete

◆ FirmwareUpdater() [3/3]

peak::core::FirmwareUpdater::FirmwareUpdater ( FirmwareUpdater &&  other)
delete

Member Function Documentation

◆ CollectFirmwareUpdateInformation() [1/2]

std::vector< std::shared_ptr< FirmwareUpdateInformation > > peak::core::FirmwareUpdater::CollectFirmwareUpdateInformation ( const std::string &  gufPath) const
inline

Collects all firmware update information of a given *.guf file.

Parameters
[in]gufPathThe path of the *.guf file containing the firmware update.
Returns
A list of firmware update information.
Since
1.2
Exceptions
InvalidArgumentExceptionOne of the submitted arguments is outside the valid range or is not supported.
InternalErrorExceptionAn internal error has occurred.

◆ CollectFirmwareUpdateInformation() [2/2]

std::vector< std::shared_ptr< FirmwareUpdateInformation > > peak::core::FirmwareUpdater::CollectFirmwareUpdateInformation ( const std::string &  gufPath,
const std::shared_ptr< DeviceDescriptor > &  device 
) const
inline

Collects the firmware update information of a given *.guf file fitting to a given device.

Parameters
[in]gufPathThe path of the *.guf file containing the firmware update.
[in]deviceThe device to update.
Returns
A list of firmware update information fitting to the given device
Since
1.0
Exceptions
InvalidArgumentExceptionOne of the submitted arguments is outside the valid range or is not supported.
InternalErrorExceptionAn internal error has occurred.

◆ operator=() [1/2]

FirmwareUpdater& peak::core::FirmwareUpdater::operator= ( const FirmwareUpdater &  other)
delete

◆ operator=() [2/2]

FirmwareUpdater& peak::core::FirmwareUpdater::operator= ( FirmwareUpdater &&  other)
delete

◆ UpdateDevice()

void peak::core::FirmwareUpdater::UpdateDevice ( const std::shared_ptr< DeviceDescriptor > &  device,
const std::shared_ptr< FirmwareUpdateInformation > &  updateInformation,
const FirmwareUpdateProgressObserver *  progressObserver = nullptr,
Timeout  deviceResetDiscoveryTimeout = Timeout(60000ms) 
)
inline

Updates a given device by using a given firmware update information.

This is a blocking call, i.e. it only returns once the update is done. Depending on the device, the update may take several minutes. To watch the progress during the update, pass a FirmwareUpdateProgressObserver.

Parameters
[in]deviceThe device to update.
[in]updateInformationThe firmware update information to update the device.
[in]progressObserverThe progress observer to observe the update process. It is optional.
[in]deviceResetDiscoveryTimeoutTime to wait for a device to reboot during the update.
Note
The DeviceDescriptor passed to this function will be invalid after the update. Update the DeviceManager/Interface and retrieve a new DeviceDescriptor.
Since
1.0
1.2 Added deviceResetDiscoveryTimeout parameter.
Exceptions
InvalidArgumentExceptionOne of the submitted arguments is outside the valid range or is not supported.
InternalErrorExceptionAn internal error has occurred.
TimeoutExceptionThe deviceResetDiscoveryTimeout was exceeded.

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