6#include "../../global.hpp"
7#include "../../string.hpp"
8#include "../../utilities/system_info.hpp"
10#include "../genapi.hpp"
13# pragma warning(push, 1)
14# pragma warning(disable : 4244)
23 inline HandleGuard<GenApi::FWUpdater>::HandleGuard(
void *handle) noexcept
24 : HandleGuard<GenApi::FWUpdater>(handle, [](
void *handle) { CVB_CALL_CAPI(
ReleaseObject(handle)); })
59 FWUpdater(HandleGuard<FWUpdater> &&guard,
const String &filename, PrivateTag)
noexcept;
71 explicit FWUpdater(
const String &filename,
bool verify =
true);
73 FWUpdater(
const FWUpdater &other) =
delete;
74 FWUpdater &operator=(
const FWUpdater &other) =
delete;
75 FWUpdater(FWUpdater &&other)
noexcept =
default;
76 FWUpdater &operator=(FWUpdater &&other)
noexcept =
default;
77 ~FWUpdater() =
default;
99 return handle_.Handle();
156 String DeviceSerialNumber() const noexcept;
160 static
void NativeCall(std::function<CExports::cvbres_t()> fn)
170 stream <<
"FWUpdater: " << message;
176 T NativeCall(
std::function<CExports::cvbres_t(T &value)> fn)
const
179 auto result = fn(value);
187 stream <<
"FWUpdater: " << message;
193 static CExports::cvbbool_t __stdcall EventOnDeviceReset(
unsigned int deviceDiscoveryTimeoutMs,
194 unsigned int deviceDiscoveryDelayMs,
195 CExports::NODEMAP &nodeMap,
void *pPrivate);
197 HandleGuard<FWUpdater> handle_;
199 size_t updateFileIndex_ = 0;
Firmware updater class.
Definition decl_fw_updater.hpp:40
std::vector< std::pair< String, String > > AvailableGufInfo()
Collects all key value pairs available in a guf file.
Definition detail_fw_updater.hpp:87
std::vector< String > UpdateFileInfos(const size_t &updateFileIndex)
Collects all information on a single update file available in a guf file.
Definition detail_fw_updater.hpp:133
std::vector< String > AvailableUpdateFiles()
Collects all mandatory update file infos available in a guf file.
Definition detail_fw_updater.hpp:108
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.
Definition detail_fw_updater.hpp:66
size_t UpdateFileInfoCount(const size_t &fileIndex)
Gets the number of available update infos in a guf file.
Definition detail_fw_updater.hpp:60
static std::unique_ptr< FWUpdater > Create(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.
Definition detail_fw_updater.hpp:28
size_t UpdateFileCount()
Gets the number of available update files in a guf file.
Definition detail_fw_updater.hpp:55
static std::unique_ptr< FWUpdater > FromHandle(HandleGuard< FWUpdater > &&guard, const String &filename)
Creates a firmware updater from a classic API handle.
Definition detail_fw_updater.hpp:47
void * Handle() const noexcept
Classic API node map handle.
Definition decl_fw_updater.hpp:97
void Update(DevicePtr &&device, const size_t updateFileSelection)
Update the device.
Definition detail_fw_updater.hpp:146
cvbbool_t ReleaseObject(OBJ &Object)
Namespace for GenApi based device configuration.
Definition decl_fw_updater.hpp:29
FirmwareUpdateInfo
Defines commands to retrieve firmware information from a guf file.
Definition genapi.hpp:259
std::shared_ptr< NodeMap > NodeMapPtr
Convenience shared pointer for NodeMap.
Definition genapi.hpp:27
std::string GetLastErrorMessage()
Returns the last error message.
Definition system_info.hpp:167
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
std::string String
String for wide characters or unicode characters.
Definition string.hpp:49
std::shared_ptr< Device > DevicePtr
Convenience shared pointer for Device.
Definition global.hpp:98
T rethrow_exception(T... args)