mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 09:28:40 +02:00
DeviceSettings: Remove checksum validation
This commit is contained in:
@@ -729,7 +729,7 @@ public:
|
||||
using TerminationGroup = std::vector<Network>;
|
||||
|
||||
static constexpr uint16_t GS_VERSION = 5;
|
||||
static std::optional<uint16_t> CalculateGSChecksum(const std::vector<uint8_t>& settings, std::optional<size_t> knownSize = std::nullopt);
|
||||
static std::optional<uint16_t> CalculateGSChecksum(const std::vector<uint8_t>& settings);
|
||||
static CANBaudrate GetEnumValueForBaudrate(int64_t baudrate);
|
||||
static int64_t GetBaudrateValueForEnum(CANBaudrate enumValue);
|
||||
static bool ValidateLINBaudrate(int64_t baudrate);
|
||||
@@ -738,7 +738,7 @@ public:
|
||||
virtual ~IDeviceSettings() {}
|
||||
bool ok() const { return !disabled && settingsLoaded; }
|
||||
|
||||
virtual bool refresh(bool ignoreChecksum = false); // Get from device
|
||||
virtual bool refresh(); // Get from device
|
||||
|
||||
// Send to device, if temporary device keeps settings in volatile RAM until power cycle, otherwise saved to EEPROM
|
||||
virtual bool apply(bool temporary = false);
|
||||
@@ -946,7 +946,6 @@ public:
|
||||
bool disabled = false;
|
||||
|
||||
bool readonly = false;
|
||||
bool disableGSChecksumming = false;
|
||||
|
||||
std::atomic<bool> applyingSettings{false};
|
||||
protected:
|
||||
|
||||
@@ -75,7 +75,6 @@ static_assert(sizeof(radpluto_settings_t) == 322, "RAD-Pluto Settings are not pa
|
||||
class RADPlutoSettings : public IDeviceSettings {
|
||||
public:
|
||||
RADPlutoSettings(std::shared_ptr<Communication> com) : IDeviceSettings(com, sizeof(radpluto_settings_t)) {
|
||||
disableGSChecksumming = true;
|
||||
}
|
||||
|
||||
const CAN_SETTINGS* getCANSettingsFor(Network net) const override {
|
||||
|
||||
@@ -70,7 +70,6 @@ typedef struct {
|
||||
class RADStar2Settings : public IDeviceSettings {
|
||||
public:
|
||||
RADStar2Settings(std::shared_ptr<Communication> com) : IDeviceSettings(com, sizeof(radstar2_settings_t)) {
|
||||
disableGSChecksumming = true;
|
||||
}
|
||||
|
||||
const CAN_SETTINGS* getCANSettingsFor(Network net) const override {
|
||||
|
||||
@@ -89,11 +89,11 @@ public:
|
||||
};
|
||||
}
|
||||
|
||||
bool refresh(bool ignoreChecksum = false) override {
|
||||
bool refresh() override {
|
||||
// Because VividCAN uses a nonstandard 16-bit termination_enables
|
||||
// we need to keep the standard 64-bit values in memory and update
|
||||
// the structure when applying
|
||||
if(!IDeviceSettings::refresh(ignoreChecksum))
|
||||
if(!IDeviceSettings::refresh())
|
||||
return false;
|
||||
auto cfg = getStructurePointer<vividcan_settings_t>();
|
||||
if(cfg == nullptr)
|
||||
|
||||
Reference in New Issue
Block a user