Allow returning to the default settings

This commit is contained in:
Paul Hollinsky
2018-10-08 19:03:12 -04:00
parent 7d821b9745
commit b3471890eb
5 changed files with 96 additions and 24 deletions
+5 -2
View File
@@ -278,6 +278,7 @@ namespace icsneo {
class IDeviceSettings {
public:
static constexpr uint16_t GS_VERSION = 5;
static uint16_t CalculateGSChecksum(const std::vector<uint8_t>& settings);
IDeviceSettings(std::shared_ptr<Communication> com, size_t size) : com(com), structSize(size) {}
@@ -285,8 +286,10 @@ public:
bool ok() { return settingsLoaded; }
void refresh(bool ignoreChecksum = false); // Get from device
bool send(); // Send to device, device keeps settings in volatile RAM until power cycle
bool commit(); // Send to device, device keeps settings in EEPROM until next commit
// Send to device, if temporary device keeps settings in volatile RAM until power cycle, otherwise saved to EEPROM
bool apply(bool temporary = false);
bool applyDefaults(bool temporary = false);
virtual bool setBaudrateFor(Network net, uint32_t baudrate);