Fix grpflg detection

Fix grpflg detection (#8095)
This commit is contained in:
Theo Arends 2020-04-09 11:51:39 +02:00
parent e69f103755
commit 24fa00ad57

View File

@ -182,7 +182,13 @@ void CommandHandler(char* topicBuf, char* dataBuf, uint32_t data_len)
data_len--;
}
bool grpflg = (strstr(topicBuf, SettingsText(SET_MQTT_GRP_TOPIC)) != nullptr);
bool grpflg = false;
uint32_t real_index = SET_MQTT_GRP_TOPIC;
for (uint32_t i = 0; i < MAX_GROUP_TOPICS; i++) {
if (1 == i) { real_index = SET_MQTT_GRP_TOPIC2 -1; }
grpflg = (strstr(topicBuf, SettingsText(real_index +i)) != nullptr);
if (grpflg) { break; }
}
char stemp1[TOPSZ];
GetFallbackTopic_P(stemp1, ""); // Full Fallback topic = cmnd/DVES_xxxxxxxx_fb/