Settings: The device can report when defaults were applied
parent
80362e7f81
commit
6cc0f08e2b
|
|
@ -103,6 +103,7 @@ static constexpr const char* TERMINATION_NOT_SUPPORTED_DEVICE = "This device doe
|
||||||
static constexpr const char* TERMINATION_NOT_SUPPORTED_NETWORK = "This network does not support software selectable termination on this device.";
|
static constexpr const char* TERMINATION_NOT_SUPPORTED_NETWORK = "This network does not support software selectable termination on this device.";
|
||||||
static constexpr const char* ANOTHER_IN_TERMINATION_GROUP_ENABLED = "A mutually exclusive network already has termination enabled.";
|
static constexpr const char* ANOTHER_IN_TERMINATION_GROUP_ENABLED = "A mutually exclusive network already has termination enabled.";
|
||||||
static constexpr const char* ETH_PHY_REGISTER_CONTROL_NOT_AVAILABLE = "Ethernet PHY register control is not available for this device.";
|
static constexpr const char* ETH_PHY_REGISTER_CONTROL_NOT_AVAILABLE = "Ethernet PHY register control is not available for this device.";
|
||||||
|
static constexpr const char* SETTINGS_DEFAULTS_USED = "The device settings could not be loaded, the default settings have been applied.";
|
||||||
|
|
||||||
// Transport Errors
|
// Transport Errors
|
||||||
static constexpr const char* FAILED_TO_READ = "A read operation failed.";
|
static constexpr const char* FAILED_TO_READ = "A read operation failed.";
|
||||||
|
|
@ -214,6 +215,8 @@ const char* APIEvent::DescriptionForType(Type type) {
|
||||||
return NO_SERIAL_NUMBER_FW_12V;
|
return NO_SERIAL_NUMBER_FW_12V;
|
||||||
case Type::EthPhyRegisterControlNotAvailable:
|
case Type::EthPhyRegisterControlNotAvailable:
|
||||||
return ETH_PHY_REGISTER_CONTROL_NOT_AVAILABLE;
|
return ETH_PHY_REGISTER_CONTROL_NOT_AVAILABLE;
|
||||||
|
case Type::SettingsDefaultsUsed:
|
||||||
|
return SETTINGS_DEFAULTS_USED;
|
||||||
|
|
||||||
// Transport Errors
|
// Transport Errors
|
||||||
case Type::FailedToRead:
|
case Type::FailedToRead:
|
||||||
|
|
|
||||||
|
|
@ -125,8 +125,10 @@ bool Communication::getSettingsSync(std::vector<uint8_t>& data, std::chrono::mil
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(gsmsg->response != ReadSettingsMessage::Response::OK) {
|
if(gsmsg->response == ReadSettingsMessage::Response::OKDefaultsUsed) {
|
||||||
report(APIEvent::Type::Unknown, APIEvent::Severity::Error);
|
report(APIEvent::Type::SettingsDefaultsUsed, APIEvent::Severity::EventInfo);
|
||||||
|
} else if(gsmsg->response != ReadSettingsMessage::Response::OK) {
|
||||||
|
report(APIEvent::Type::SettingsReadError, APIEvent::Severity::Error);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,7 @@ public:
|
||||||
NoSerialNumber12V = 0x2028, // The device must be powered with 12V for communication to be established
|
NoSerialNumber12V = 0x2028, // The device must be powered with 12V for communication to be established
|
||||||
NoSerialNumberFW12V = 0x2029, // The device must be powered with 12V for communication to be established, a firmware update was already attempted
|
NoSerialNumberFW12V = 0x2029, // The device must be powered with 12V for communication to be established, a firmware update was already attempted
|
||||||
EthPhyRegisterControlNotAvailable = 0x2030, //The device doesn't support Ethernet PHY MDIO access
|
EthPhyRegisterControlNotAvailable = 0x2030, //The device doesn't support Ethernet PHY MDIO access
|
||||||
|
SettingsDefaultsUsed = 0x2033,
|
||||||
|
|
||||||
// Transport Events
|
// Transport Events
|
||||||
FailedToRead = 0x3000,
|
FailedToRead = 0x3000,
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@ public:
|
||||||
InvalidSubversion = 3,
|
InvalidSubversion = 3,
|
||||||
NotEnoughMemory = 4,
|
NotEnoughMemory = 4,
|
||||||
APIFailure = 5,
|
APIFailure = 5,
|
||||||
APIUnsupported = 6
|
APIUnsupported = 6,
|
||||||
|
OKDefaultsUsed = 7, // Got the settings okay, but the defaults were used (after firmware upgrade or a checksum error)
|
||||||
};
|
};
|
||||||
|
|
||||||
Response response;
|
Response response;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue