IDS peak genericC++ v1.9.0
Loading...
Searching...
No Matches
peak_firmware_update_information.hpp
Go to the documentation of this file.
1
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
29{
30 None,
31 Full
32};
33
41{
47 Dotted,
52};
53
63{
64public:
71
82 bool IsValid() const;
83
93 std::string FileName() const;
94
104 std::string Description() const;
105
115 std::string Version() const;
116
129 std::string VersionExtractionPattern() const;
130
144
154 std::string ReleaseNotes() const;
155
167 std::string ReleaseNotesURL() const;
168
179
190
191private:
192 friend ClassCreator<FirmwareUpdateInformation>;
193 explicit FirmwareUpdateInformation(PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE firmwareUpdateInformationHandle);
195
196 friend class FirmwareUpdater;
197};
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 */
Represents a single firmware update information.
Definition peak_firmware_update_information.hpp:63
FirmwareUpdateVersionStyle VersionStyle() const
The style of the Version() value.
Definition peak_firmware_update_information.hpp:251
std::string VersionExtractionPattern() const
Regular expression to extract the device version from the DeviceFirmwareVersion node.
Definition peak_firmware_update_information.hpp:243
FirmwareUpdatePersistence UserSetPersistence() const
Specifies if the device persists user sets during the update.
Definition peak_firmware_update_information.hpp:277
FirmwareUpdatePersistence SequencerSetPersistence() const
Specifies if the device persists sequencer sets during the update.
Definition peak_firmware_update_information.hpp:287
std::string Version() const
Returns the version of the firmware update.
Definition peak_firmware_update_information.hpp:236
std::string ReleaseNotesURL() const
A link to a webpage with more release notes.
Definition peak_firmware_update_information.hpp:269
std::string Description() const
Returns the description of the firmware update.
Definition peak_firmware_update_information.hpp:228
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
bool IsValid() const
Checks whether the information held are valid.
Definition peak_firmware_update_information.hpp:213
FirmwareUpdateInformation & operator=(const FirmwareUpdateInformation &other)=delete
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
Allows to update the firmware of a device.
Definition peak_firmware_updater.hpp:46
Implements versioning functionality.
Definition peak_version.hpp:34
FirmwareUpdateVersionStyle
The style of the version value.
Definition peak_firmware_update_information.hpp:41
FirmwareUpdatePersistence
Specifies if the device persists user sets and/or sequencer sets during the update.
Definition peak_firmware_update_information.hpp:29
@ None
All sets are reset to default values during the update.
@ Full
The device guarantees, that all sets are persisted during the update.
The "peak" namespace directly contains convenience functionality like the DeviceManager as well as th...
Definition peak_dynamic_loader.h:33
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:176
struct PEAK_FIRMWARE_UPDATE_INFORMATION * PEAK_FIRMWARE_UPDATE_INFORMATION_HANDLE
Definition peak_backend.h:476
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:197
int8_t PEAK_BOOL8
Definition peak_backend.h:26
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