MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / applyModbusRegisters

Function applyModbusRegisters

app/src/Misc/CLI.cpp:962–973  ·  view source on GitHub ↗

* @brief Applies all --modbus-register specs and warns if none are present. */

Source from the content-addressed store, hash-verified

960 * @brief Applies all --modbus-register specs and warns if none are present.
961 */
962static void applyModbusRegisters(const QCommandLineParser& parser, const QCommandLineOption& opt)
963{
964 IO::ConnectionManager::instance().modbus()->clearRegisterGroups();
965 if (!parser.isSet(opt)) {
966 qWarning() << "No register groups specified. Use --modbus-register to add registers.";
967 return;
968 }
969
970 const QStringList registerSpecs = parser.values(opt);
971 for (const QString& spec : std::as_const(registerSpecs))
972 applyModbusRegister(spec);
973}
974
975/**
976 * @brief Parses a Modbus TCP host[:port] string.

Callers 2

Calls 3

applyModbusRegisterFunction · 0.85
modbusMethod · 0.80
clearRegisterGroupsMethod · 0.45

Tested by

no test coverage detected