Power Switcher Component #596

Merged
muellerr merged 9 commits from eive/fsfw:mueller/power-switcher-component-upstream into development 2022-05-13 22:42:23 +02:00
Showing only changes of commit 72e0938f9a - Show all commits

View File

@ -16,28 +16,28 @@ void DummyPowerSwitcher::setInitialFusesList(std::vector<ReturnValue_t> fuseList
}
ReturnValue_t DummyPowerSwitcher::sendSwitchCommand(power::Switch_t switchNr, ReturnValue_t onOff) {
if (switchNr < switcherList.capacity()) {
if (switchNr < switcherList.size()) {
switcherList[switchNr] = onOff;
}
return RETURN_FAILED;
}
ReturnValue_t DummyPowerSwitcher::sendFuseOnCommand(uint8_t fuseNr) {
if (fuseNr < fuseList.capacity()) {
if (fuseNr < fuseList.size()) {
muellerr marked this conversation as resolved Outdated

Why do you use capacity() and not size()?

Why do you use capacity() and not size()?
fuseList[fuseNr] = FUSE_ON;
}
return RETURN_FAILED;
}
ReturnValue_t DummyPowerSwitcher::getSwitchState(power::Switch_t switchNr) const {
if (switchNr < switcherList.capacity()) {
if (switchNr < switcherList.size()) {
muellerr marked this conversation as resolved Outdated

Why do you use capacity() and not size()?

Why do you use capacity() and not size()?
return switcherList[switchNr];
}
return HasReturnvaluesIF::RETURN_FAILED;
}
ReturnValue_t DummyPowerSwitcher::getFuseState(uint8_t fuseNr) const {
if (fuseNr < fuseList.capacity()) {
if (fuseNr < fuseList.size()) {
muellerr marked this conversation as resolved Outdated

Why do you use capacity() and not size()?

Why do you use capacity() and not size()?
return fuseList[fuseNr];
}
return HasReturnvaluesIF::RETURN_FAILED;