Closed maxpejs closed 1 month ago
Thanks a lot for your report ! I have pushed a relevant fix, disallowing default ctors.
I will also try to review all classes constructors, for which I have created separate issue #10 When I was initially developing this library, I was not aware how complicated constructors can be in C++ ;)
If I create an ModbusRequest without any values, it uses the ctor with default values. There is a switch statement and a valid function code value is required, so exception will be thrown
switch (functionRegisters()) { case utils::OutputCoils: ...