When constructing ModbusResponse from rawCRC data, field _address is left uninitialized.
It's understandable to not fill this field as there is no information about it in the frame, BUT as it is uninitialised, it contains pure gibberish, So accessing it with .registerAddress() is undefined behaviour.
I think the value should be initialized to some invalid value (-1/0xFFFF ?) and .registerAddress should throw if someone tries to access it.
When constructing ModbusResponse from rawCRC data, field _address is left uninitialized.
It's understandable to not fill this field as there is no information about it in the frame, BUT as it is uninitialised, it contains pure gibberish, So accessing it with .registerAddress() is undefined behaviour.
I think the value should be initialized to some invalid value (-1/0xFFFF ?) and .registerAddress should throw if someone tries to access it.