* @brief Applies the Modbus poll-interval option to the active Modbus driver. */
| 924 | * @brief Applies the Modbus poll-interval option to the active Modbus driver. |
| 925 | */ |
| 926 | static void applyModbusPoll(const QCommandLineParser& parser, const QCommandLineOption& opt) |
| 927 | { |
| 928 | if (!parser.isSet(opt)) |
| 929 | return; |
| 930 | |
| 931 | bool ok = false; |
| 932 | quint16 interval = parser.value(opt).toUInt(&ok); |
| 933 | if (!ok || interval < 50 || interval > 60000) { |
| 934 | qWarning() << "Invalid ModBus poll interval (50-60000 ms):" << parser.value(opt); |
| 935 | return; |
| 936 | } |
| 937 | |
| 938 | IO::ConnectionManager::instance().modbus()->setPollInterval(interval); |
| 939 | } |
| 940 | |
| 941 | /** |
| 942 | * @brief Applies the Modbus serial baud-rate option to the active Modbus driver. |
no test coverage detected