IDS peak genericC++ v1.17.0
Loading...
Searching...
No Matches
peak_firmware_update_information.hpp
Go to the documentation of this file.
1
6
7#pragma once
8
10
12#include <peak/dll_interface/peak_dll_interface_util.hpp>
13
14#include <string>
15
16
17namespace peak
18{
19namespace core
20{
21
31
52
198
199} /* namespace core */
200} /* namespace peak */
201
202/* Implementation */
203namespace peak
204{
205namespace core
206{
207
209 PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle)
210 : m_backendHandle(firmwareUpdateInformationHandle)
211{}
212
214{
215 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isValid) {
216 return PEAK_C_ABI_PREFIX PEAK_FirmwareUpdateInformation_GetIsValid(m_backendHandle, isValid);
217 }) > 0;
218}
219
220inline std::string FirmwareUpdateInformation::FileName() const
221{
222 return QueryStringFromCInterfaceFunction([&](char* fileName, size_t* fileNameSize) {
224 m_backendHandle, fileName, fileNameSize);
225 });
226}
227
229{
230 return QueryStringFromCInterfaceFunction([&](char* description, size_t* descriptionSize) {
232 m_backendHandle, description, descriptionSize);
233 });
234}
235
236inline std::string FirmwareUpdateInformation::Version() const
237{
238 return QueryStringFromCInterfaceFunction([&](char* version, size_t* versionSize) {
239 return PEAK_C_ABI_PREFIX PEAK_FirmwareUpdateInformation_GetVersion(m_backendHandle, version, versionSize);
240 });
241}
242
244{
245 return QueryStringFromCInterfaceFunction([&](char* versionExtractionPattern, size_t* versionExtractionPatternSize) {
247 m_backendHandle, versionExtractionPattern, versionExtractionPatternSize);
248 });
249}
250
252{
253 return static_cast<FirmwareUpdateVersionStyle>(
254 QueryNumericFromCInterfaceFunction<PEAK_FIRMWARE_UPDATE_VERSION_STYLE>(
255 [&](PEAK_FIRMWARE_UPDATE_VERSION_STYLE* versionStyle) {
257 m_backendHandle, versionStyle);
258 }));
259}
260
262{
263 return QueryStringFromCInterfaceFunction([&](char* releaseNotes, size_t* releaseNotesSize) {
265 m_backendHandle, releaseNotes, releaseNotesSize);
266 });
267}
268
270{
271 return QueryStringFromCInterfaceFunction([&](char* releaseNotesUrl, size_t* releaseNotesUrlSize) {
273 m_backendHandle, releaseNotesUrl, releaseNotesUrlSize);
274 });
275}
276
278{
279 return static_cast<FirmwareUpdatePersistence>(
280 QueryNumericFromCInterfaceFunction<PEAK_FIRMWARE_UPDATE_PERSISTENCE>(
281 [&](PEAK_FIRMWARE_UPDATE_PERSISTENCE* userSetPersistence) {
283 m_backendHandle, userSetPersistence);
284 }));
285}
286
288{
289 return static_cast<FirmwareUpdatePersistence>(
290 QueryNumericFromCInterfaceFunction<PEAK_FIRMWARE_UPDATE_PERSISTENCE>(
291 [&](PEAK_FIRMWARE_UPDATE_PERSISTENCE* sequencerSetPersistence) {
293 m_backendHandle, sequencerSetPersistence);
294 }));
295}
296
297inline std::string ToString(FirmwareUpdatePersistence entry)
298{
299 std::string entryString;
300
302 {
303 entryString = "None";
304 }
305 else if (entry == FirmwareUpdatePersistence::Full)
306 {
307 entryString = "Full";
308 }
309
310 return entryString;
311}
312
313inline std::string ToString(FirmwareUpdateVersionStyle entry)
314{
315 std::string entryString;
316
318 {
319 entryString = "Dotted";
320 }
321 else if (entry == FirmwareUpdateVersionStyle::Semantic)
322 {
323 entryString = "Semantic";
324 }
325
326 return entryString;
327}
328
329} /* namespace core */
330} /* namespace peak */
PEAK_COMMON_NO_DISCARD FirmwareUpdateVersionStyle VersionStyle() const
The style of the Version() value.
Definition peak_firmware_update_information.hpp:251
PEAK_COMMON_NO_DISCARD std::string VersionExtractionPattern() const
Regular expression to extract the device version from the DeviceFirmwareVersion node.
Definition peak_firmware_update_information.hpp:243
PEAK_COMMON_NO_DISCARD FirmwareUpdatePersistence UserSetPersistence() const
Specifies if the device persists user sets during the update.
Definition peak_firmware_update_information.hpp:277
PEAK_COMMON_NO_DISCARD FirmwareUpdatePersistence SequencerSetPersistence() const
Specifies if the device persists sequencer sets during the update.
Definition peak_firmware_update_information.hpp:287
PEAK_COMMON_NO_DISCARD std::string Version() const
Returns the version of the firmware update.
Definition peak_firmware_update_information.hpp:236
PEAK_COMMON_NO_DISCARD std::string ReleaseNotesURL() const
A link to a webpage with more release notes.
Definition peak_firmware_update_information.hpp:269
PEAK_COMMON_NO_DISCARD std::string Description() const
Returns the description of the firmware update.
Definition peak_firmware_update_information.hpp:228
PEAK_COMMON_NO_DISCARD std::string FileName() const
Returns the file name of the package this firmware update information belongs to.
Definition peak_firmware_update_information.hpp:220
FirmwareUpdateInformation & operator=(FirmwareUpdateInformation &&other)=delete
PEAK_COMMON_NO_DISCARD bool IsValid() const
Checks whether the information held are valid.
Definition peak_firmware_update_information.hpp:213
friend class FirmwareUpdater
Definition peak_firmware_update_information.hpp:196
FirmwareUpdateInformation & operator=(const FirmwareUpdateInformation &other)=delete
PEAK_COMMON_NO_DISCARD std::string ReleaseNotes() const
Release notes of the firmware update.
Definition peak_firmware_update_information.hpp:261
FirmwareUpdateInformation(const FirmwareUpdateInformation &other)=delete
FirmwareUpdateInformation(FirmwareUpdateInformation &&other)=delete
FirmwareUpdateVersionStyle
The style of the version value.
Definition peak_firmware_update_information.hpp:40
FirmwareUpdatePersistence
Specifies if the device persists user sets and/or sequencer sets during the update.
Definition peak_firmware_update_information.hpp:27
@ Dotted
Definition peak_firmware_update_information.hpp:46
@ Semantic
Definition peak_firmware_update_information.hpp:50
@ None
All sets are reset to default values during the update.
Definition peak_firmware_update_information.hpp:28
@ Full
The device guarantees, that all sets are persisted during the update.
Definition peak_firmware_update_information.hpp:29
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:32
std::string ToString(BufferPayloadType entry)
Definition peak_buffer.hpp:635
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_buffer.hpp:29
PEAK_C_API PEAK_FirmwareUpdateInformation_GetDescription(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, char *description, size_t *descriptionSize)
Asks the given firmware update information for its description.
PEAK_C_API PEAK_FirmwareUpdateInformation_GetVersion(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, char *version, size_t *versionSize)
Asks the given firmware update information for its version.
PEAK_C_API PEAK_FirmwareUpdateInformation_GetFileName(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, char *fileName, size_t *fileNameSize)
Asks the given firmware update information for its file name.
PEAK_C_API PEAK_FirmwareUpdateInformation_GetIsValid(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, PEAK_BOOL8 *isValid)
Asks the given firmware update information whether it is valid.
PEAK_C_API PEAK_FirmwareUpdateInformation_GetVersionExtractionPattern(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, char *versionExtractionPattern, size_t *versionExtractionPatternSize)
Asks the given firmware update information for its version extraction pattern.
PEAK_C_API PEAK_FirmwareUpdateInformation_GetSequencerSetPersistence(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, PEAK_FIRMWARE_UPDATE_PERSISTENCE *sequencerSetPersistence)
Asks the given firmware update information for its sequencer set persistence.
int32_t PEAK_FIRMWARE_UPDATE_PERSISTENCE
Definition peak_backend.h:191
struct PEAK_FIRMWARE_UPDATE_INFORMATION * PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE
Definition peak_backend.h:495
PEAK_C_API PEAK_FirmwareUpdateInformation_GetVersionStyle(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, PEAK_FIRMWARE_UPDATE_VERSION_STYLE *versionStyle)
Asks the given firmware update information for its version style.
int32_t PEAK_FIRMWARE_UPDATE_VERSION_STYLE
Definition peak_backend.h:212
int8_t PEAK_BOOL8
Definition peak_backend.h:41
PEAK_C_API PEAK_FirmwareUpdateInformation_GetUserSetPersistence(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, PEAK_FIRMWARE_UPDATE_PERSISTENCE *userSetPersistence)
Asks the given firmware update information for its user set persistence.
PEAK_C_API PEAK_FirmwareUpdateInformation_GetReleaseNotesURL(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, char *releaseNotesUrl, size_t *releaseNotesUrlSize)
Asks the given firmware update information for its release notes URL.
PEAK_C_API PEAK_FirmwareUpdateInformation_GetReleaseNotes(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle, char *releaseNotes, size_t *releaseNotesSize)
Asks the given firmware update information for its release notes.
#define PEAK_COMMON_NO_DISCARD
Definition peak_common_defines.h:89
#define PEAK_C_ABI_PREFIX
Definition peak_dll_defines.h:13