modbus
modbus copied to clipboard
Implement SlaveId and Connector APIs
Intention of this PR is to remove the need for ducktyping like this:
if handler, ok := q.handler.(*modbus.RTUClientHandler); ok {
handler.SlaveId = deviceid
} else if handler, ok := q.handler.(*modbus.TCPClientHandler); ok {
handler.SlaveId = deviceid
}
Same goes for the Connect
and Close
methods which are already implemented but not exposed via interface.
Replaces https://github.com/goburrow/modbus/pull/22