IDS peak genericC++ v1.16.0
Loading...
Searching...
No Matches
peak_firmware_update_information.hpp
Go to the documentation of this file.
1
10
11#pragma once
12
13
15#include <peak/dll_interface/peak_dll_interface_util.hpp>
16
17#include <string>
18
19
20namespace peak
21{
22namespace core
23{
24
34
55
66{
67public:
74
85 bool IsValid() const;
86
96 std::string FileName() const;
97
107 std::string Description() const;
108
118 std::string Version() const;
119
132 std::string VersionExtractionPattern() const;
133
147
157 std::string ReleaseNotes() const;
158
170 std::string ReleaseNotesURL() const;
171
182
193
194private:
195 friend ClassCreator<FirmwareUpdateInformation>;
196 explicit FirmwareUpdateInformation(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle);
198
199 friend class FirmwareUpdater;
200};
201
202} /* namespace core */
203} /* namespace peak */
204
205/* Implementation */
206namespace peak
207{
208namespace core
209{
210
212 PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle)
213 : m_backendHandle(firmwareUpdateInformationHandle)
214{}
215
217{
218 return QueryNumericFromCInterfaceFunction<PEAK_BOOL8>([&](PEAK_BOOL8* isValid) {
219 return PEAK_C_ABI_PREFIX PEAK_FirmwareUpdateInformation_GetIsValid(m_backendHandle, isValid);
220 }) > 0;
221}
222
223inline std::string FirmwareUpdateInformation::FileName() const
224{
225 return QueryStringFromCInterfaceFunction([&](char* fileName, size_t* fileNameSize) {
227 m_backendHandle, fileName, fileNameSize);
228 });
229}
230
232{
233 return QueryStringFromCInterfaceFunction([&](char* description, size_t* descriptionSize) {
235 m_backendHandle, description, descriptionSize);
236 });
237}
238
239inline std::string FirmwareUpdateInformation::Version() const
240{
241 return QueryStringFromCInterfaceFunction([&](char* version, size_t* versionSize) {
242 return PEAK_C_ABI_PREFIX PEAK_FirmwareUpdateInformation_GetVersion(m_backendHandle, version, versionSize);
243 });
244}
245
247{
248 return QueryStringFromCInterfaceFunction([&](char* versionExtractionPattern, size_t* versionExtractionPatternSize) {
250 m_backendHandle, versionExtractionPattern, versionExtractionPatternSize);
251 });
252}
253
255{
256 return static_cast<FirmwareUpdateVersionStyle>(
257 QueryNumericFromCInterfaceFunction<PEAK_FIRMWARE_UPDATE_VERSION_STYLE>(
258 [&](PEAK_FIRMWARE_UPDATE_VERSION_STYLE* versionStyle) {
260 m_backendHandle, versionStyle);
261 }));
262}
263
265{
266 return QueryStringFromCInterfaceFunction([&](char* releaseNotes, size_t* releaseNotesSize) {
268 m_backendHandle, releaseNotes, releaseNotesSize);
269 });
270}
271
273{
274 return QueryStringFromCInterfaceFunction([&](char* releaseNotesUrl, size_t* releaseNotesUrlSize) {
276 m_backendHandle, releaseNotesUrl, releaseNotesUrlSize);
277 });
278}
279
281{
282 return static_cast<FirmwareUpdatePersistence>(
283 QueryNumericFromCInterfaceFunction<PEAK_FIRMWARE_UPDATE_PERSISTENCE>(
284 [&](PEAK_FIRMWARE_UPDATE_PERSISTENCE* userSetPersistence) {
286 m_backendHandle, userSetPersistence);
287 }));
288}
289
291{
292 return static_cast<FirmwareUpdatePersistence>(
293 QueryNumericFromCInterfaceFunction<PEAK_FIRMWARE_UPDATE_PERSISTENCE>(
294 [&](PEAK_FIRMWARE_UPDATE_PERSISTENCE* sequencerSetPersistence) {
296 m_backendHandle, sequencerSetPersistence);
297 }));
298}
299
300inline std::string ToString(FirmwareUpdatePersistence entry)
301{
302 std::string entryString;
303
305 {
306 entryString = "None";
307 }
308 else if (entry == FirmwareUpdatePersistence::Full)
309 {
310 entryString = "Full";
311 }
312
313 return entryString;
314}
315
316inline std::string ToString(FirmwareUpdateVersionStyle entry)
317{
318 std::string entryString;
319
321 {
322 entryString = "Dotted";
323 }
324 else if (entry == FirmwareUpdateVersionStyle::Semantic)
325 {
326 entryString = "Semantic";
327 }
328
329 return entryString;
330}
331
332} /* namespace core */
333} /* namespace peak */
FirmwareUpdateVersionStyle VersionStyle() const
The style of the Version() value.
Definition peak_firmware_update_information.hpp:254
std::string VersionExtractionPattern() const
Regular expression to extract the device version from the DeviceFirmwareVersion node.
Definition peak_firmware_update_information.hpp:246
FirmwareUpdatePersistence UserSetPersistence() const
Specifies if the device persists user sets during the update.
Definition peak_firmware_update_information.hpp:280
FirmwareUpdatePersistence SequencerSetPersistence() const
Specifies if the device persists sequencer sets during the update.
Definition peak_firmware_update_information.hpp:290
std::string Version() const
Returns the version of the firmware update.
Definition peak_firmware_update_information.hpp:239
std::string ReleaseNotesURL() const
A link to a webpage with more release notes.
Definition peak_firmware_update_information.hpp:272
std::string Description() const
Returns the description of the firmware update.
Definition peak_firmware_update_information.hpp:231
std::string FileName() const
Returns the file name of the package this firmware update information belongs to.
Definition peak_firmware_update_information.hpp:223
FirmwareUpdateInformation & operator=(FirmwareUpdateInformation &&other)=delete
bool IsValid() const
Checks whether the information held are valid.
Definition peak_firmware_update_information.hpp:216
friend class FirmwareUpdater
Definition peak_firmware_update_information.hpp:199
FirmwareUpdateInformation & operator=(const FirmwareUpdateInformation &other)=delete
std::string ReleaseNotes() const
Release notes of the firmware update.
Definition peak_firmware_update_information.hpp:264
FirmwareUpdateInformation(const FirmwareUpdateInformation &other)=delete
FirmwareUpdateInformation(FirmwareUpdateInformation &&other)=delete
FirmwareUpdateVersionStyle
The style of the version value.
Definition peak_firmware_update_information.hpp:43
FirmwareUpdatePersistence
Specifies if the device persists user sets and/or sequencer sets during the update.
Definition peak_firmware_update_information.hpp:30
@ Dotted
Definition peak_firmware_update_information.hpp:49
@ Semantic
Definition peak_firmware_update_information.hpp:53
@ None
All sets are reset to default values during the update.
Definition peak_firmware_update_information.hpp:31
@ Full
The device guarantees, that all sets are persisted during the update.
Definition peak_firmware_update_information.hpp:32
The "core" namespace contains the direct GenAPI and GenTL wrapper.
Definition peak_buffer.hpp:34
std::string ToString(BufferPayloadType entry)
Definition peak_buffer.hpp:612
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:35
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:193
struct PEAK_FIRMWARE_UPDATE_INFORMATION * PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE
Definition peak_backend.h:497
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:214
int8_t PEAK_BOOL8
Definition peak_backend.h:43
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_C_ABI_PREFIX
Definition peak_dll_defines.h:16