mirror of
https://github.com/intrepidcs/libicsneo.git
synced 2026-08-05 01:18:36 +02:00
Added error checking to functions called from Communication
This commit is contained in:
+1
-3
@@ -171,7 +171,6 @@ bool Device::open() {
|
||||
handleInternalMessage(message);
|
||||
}));
|
||||
|
||||
opened = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -185,8 +184,7 @@ bool Device::close() {
|
||||
com->removeMessageCallback(internalHandlerCallbackID);
|
||||
|
||||
goOffline();
|
||||
opened = !com->close();
|
||||
return !opened;
|
||||
return com->close();
|
||||
}
|
||||
|
||||
bool Device::goOnline() {
|
||||
|
||||
@@ -347,7 +347,7 @@ int64_t IDeviceSettings::getBaudrateFor(Network net) const {
|
||||
return baudrate;
|
||||
}
|
||||
default:
|
||||
err(APIError::BadNetworkType);
|
||||
err(APIError::UnexpectedNetworkType);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -426,7 +426,7 @@ bool IDeviceSettings::setBaudrateFor(Network net, int64_t baudrate) {
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
err(APIError::BadNetworkType);
|
||||
err(APIError::UnexpectedNetworkType);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -458,7 +458,7 @@ int64_t IDeviceSettings::getFDBaudrateFor(Network net) const {
|
||||
return baudrate;
|
||||
}
|
||||
default:
|
||||
err(APIError::BadNetworkType);
|
||||
err(APIError::UnexpectedNetworkType);
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -496,7 +496,7 @@ bool IDeviceSettings::setFDBaudrateFor(Network net, int64_t baudrate) {
|
||||
return true;
|
||||
}
|
||||
default:
|
||||
err(APIError::BadNetworkType);
|
||||
err(APIError::UnexpectedNetworkType);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user