Device: Implement version handling

This commit is contained in:
Paul Hollinsky
2021-05-05 02:17:38 -04:00
parent 8be3bbaee5
commit 595cc36545
12 changed files with 183 additions and 1 deletions
+7
View File
@@ -15,6 +15,7 @@
#include "icsneo/device/idevicesettings.h"
#include "icsneo/device/nullsettings.h"
#include "icsneo/device/devicetype.h"
#include "icsneo/device/deviceversion.h"
#include "icsneo/communication/communication.h"
#include "icsneo/communication/packetizer.h"
#include "icsneo/communication/encoder.h"
@@ -210,6 +211,11 @@ public:
NODISCARD("If the Lifetime is not held, disconnects will be immediately unsuppressed")
Lifetime suppressDisconnects();
/**
* For use by extensions only. A more stable API will be provided in the future.
*/
const std::vector<optional<DeviceAppVersion>>& getVersions() const { return versions; }
/**
* Some alternate communication protocols do not support DFU
*/
@@ -328,6 +334,7 @@ protected:
private:
neodevice_t data;
std::shared_ptr<ResetStatusMessage> latestResetStatus;
std::vector<optional<DeviceAppVersion>> versions;
mutable std::mutex extensionsLock;
std::vector<std::shared_ptr<DeviceExtension>> extensions;