schrack: Fix version regular expression in the discovery

fox-schrack-regexp
Simon Stürz 2026-01-29 11:33:12 +01:00
parent 431dc43776
commit b9deed2d06
1 changed files with 2 additions and 1 deletions

View File

@ -84,7 +84,8 @@ void CionDiscovery::tryConnect(ModbusRtuMaster *master, quint16 slaveId)
// Examples of how this looks like:
// EBE 1.2: "V1.2 15.02.2021"
// ICC: "003090056-01 20220913"
if (QRegularExpression("[A-Z0-9\\.- ]{18,32}").match(firmwareVersion).hasMatch()) {
// Regex accepts uppercase letters, digits, dots, spaces and dashes; dash is escaped to avoid invalid range
if (QRegularExpression(QStringLiteral("[A-Z0-9. \\-]{18,32}")).match(firmwareVersion).hasMatch()) {
Result result {master->modbusUuid(), firmwareVersion, slaveId};
m_discoveryResults.append(result);
}