Documentation
¶
Overview ¶
modbusrelay package implements control for Modbus relay modules.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RelayController ¶
type RelayController struct {
// contains filtered or unexported fields
}
RelayController represents a Modbus relay controller.
func (*RelayController) Close ¶
func (rc *RelayController) Close() error
Close closes the Modbus connection.
func (*RelayController) SetRelayOff ¶
func (rc *RelayController) SetRelayOff(relayNum uint16) error
SetRelayOff turns off the specified relay.
func (*RelayController) SetRelayOn ¶
func (rc *RelayController) SetRelayOn(relayNum uint16) error
SetRelayOn turns on the specified relay.
type RelayControllerInterface ¶ added in v1.0.1
type RelayControllerInterface interface {
SetRelayOn(relayNum uint16) error
SetRelayOff(relayNum uint16) error
Close() error
}
RelayControllerInterface defines methods for controlling relays.
func NewRelayController ¶
func NewRelayController(device string, baudRate uint, slaveID byte) (RelayControllerInterface, error)
NewRelayController creates a new RelayController instance.
Click to show internal directories.
Click to hide internal directories.