Feature: Allowed Submodes Mask for Mode List Entry #130

Merged
muellerr merged 5 commits from feature_allow_submodes_mode_list_entry into develop 2023-03-07 17:20:48 +01:00
Showing only changes of commit af58c414fc - Show all commits

View File

@ -25,13 +25,18 @@ ReturnValue_t SubsystemBase::checkStateAgainstTable(HybridIterator<ModeListEntry
std::map<object_id_t, ChildInfo>::iterator childIter;
auto checkSubmode = [&]() {
uint8_t mask;
bool submodesAllowedMask = tableIter.value->submodesAllowed(&mask);
uint8_t submodeToCheckAgainst = tableIter.value->getSubmode();
if (tableIter.value->inheritSubmode()) {
if (childIter->second.submode != targetSubmode) {
submodeToCheckAgainst = targetSubmode;
}
if (not submodesAllowedMask) {
if (childIter->second.submode != submodeToCheckAgainst) {
return returnvalue::FAILED;
}
}
uint8_t mask;
if (tableIter.value->submodesAllowed(&mask)) {
if (submodesAllowedMask) {
if ((childIter->second.submode | mask) != mask) {
return returnvalue::FAILED;
}