mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
VividCAN: Better "Online Not Supported" Error
This commit is contained in:
@@ -94,6 +94,7 @@ static constexpr const char* MESSAGE_FORMATTING = "The message was not properly
|
||||
static constexpr const char* CANFD_NOT_SUPPORTED = "This device does not support CANFD.";
|
||||
static constexpr const char* RTR_NOT_SUPPORTED = "RTR is not supported with CANFD.";
|
||||
static constexpr const char* DEVICE_DISCONNECTED = "The device was disconnected.";
|
||||
static constexpr const char* ONLINE_NOT_SUPPORTED = "This device does not support going online.";
|
||||
|
||||
// Transport Errors
|
||||
static constexpr const char* FAILED_TO_READ = "A read operation failed.";
|
||||
@@ -187,6 +188,8 @@ const char* APIEvent::DescriptionForType(Type type) {
|
||||
return RTR_NOT_SUPPORTED;
|
||||
case Type::DeviceDisconnected:
|
||||
return DEVICE_DISCONNECTED;
|
||||
case Type::OnlineNotSupported:
|
||||
return ONLINE_NOT_SUPPORTED;
|
||||
|
||||
// Transport Errors
|
||||
case Type::FailedToRead:
|
||||
|
||||
@@ -71,6 +71,7 @@ public:
|
||||
CANFDNotSupported = 0x2020,
|
||||
RTRNotSupported = 0x2021,
|
||||
DeviceDisconnected = 0x2022,
|
||||
OnlineNotSupported = 0x2023,
|
||||
|
||||
// Transport Events
|
||||
FailedToRead = 0x3000,
|
||||
|
||||
@@ -23,7 +23,16 @@ public:
|
||||
return found;
|
||||
}
|
||||
|
||||
bool goOnline() override { return false; }
|
||||
// VividCAN does not go online, you can only set settings
|
||||
bool goOnline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool goOffline() override {
|
||||
report(APIEvent::Type::OnlineNotSupported, APIEvent::Severity::Error);
|
||||
return false;
|
||||
}
|
||||
|
||||
private:
|
||||
VividCAN(neodevice_t neodevice) : Device(neodevice) {
|
||||
|
||||
Reference in New Issue
Block a user