DeviceSettings: Remove checksum validation

This commit is contained in:
Kyle Schwarz
2025-10-06 15:36:55 -04:00
parent 895cd0792c
commit ec350b522a
6 changed files with 14 additions and 43 deletions
+2 -3
View File
@@ -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)