Added error reporting to idevicesettings

This commit is contained in:
EricLiu2000
2019-06-13 16:01:35 -04:00
parent 965679c370
commit a16f2843d8
4 changed files with 221 additions and 39 deletions
+11
View File
@@ -50,6 +50,17 @@ public:
SettingsLengthError = 0x2005,
SettingsChecksumError = 0x2006,
SettingsNotAvailable = 0x2007,
SettingsReadOnly = 0x2008,
CANSettingsNotAvailable = 0x2009,
CANFDSettingsNotAvailable = 0x2010,
LSFTCANSettingsNotAvailable = 0x2011,
SWCANSettingsNotAvailable = 0x2012,
BaudrateNotFound = 0x2013,
BadNetworkType = 0x2014,
DeviceFirmwareOutOfDate = 0x2015,
SettingsStructureMismatch = 0x2016,
SettingsStructureTruncated = 0x2017,
NoDeviceResponse = 0x2018,
// Transport Errors
FailedToRead = 0x3000,
+4
View File
@@ -399,13 +399,17 @@ public:
const size_t& getSize() const { return structSize; }
// if settings are disabled for this device. always false unless constructed null
bool disabled = false;
bool readonly = false;
bool disableGSChecksumming = false;
protected:
std::shared_ptr<Communication> com;
device_errorhandler_t err;
size_t structSize;
// if we hold any local copies of the device settings
bool settingsLoaded = false;
std::vector<uint8_t> settings; // For writing settings to, calling apply() should copy over to device RAM (and EEPROM)