modbus icon indicating copy to clipboard operation
modbus copied to clipboard

Implement SlaveId and Connector APIs

Open andig opened this issue 5 years ago • 0 comments

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

andig avatar Oct 09 '18 07:10 andig