Added error checking to functions called from Communication

This commit is contained in:
EricLiu2000
2019-06-13 16:01:35 -04:00
parent a16f2843d8
commit 519e64fb17
12 changed files with 77 additions and 28 deletions
+1 -3
View File
@@ -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() {
+4 -4
View File
@@ -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;
}
}