Documentation
¶
Index ¶
- type Client
- func (c *Client) Close() error
- func (c *Client) Connect() error
- func (c *Client) ProbeSlaveID(maxID byte) (byte, error)
- func (c *Client) ReadRegisters(startAddr uint16, count uint16) ([]uint16, error)
- func (c *Client) ScanFrames(callback func(modbusFrame []byte) bool) error
- func (c *Client) WriteMultipleRegisters(startAddr uint16, values []uint16) error
- func (c *Client) WriteSingleRegister(addr uint16, value uint16) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
Debug bool
// contains filtered or unexported fields
}
Client communicates with an inverter through a Solarman V5 wifi dongle.
func (*Client) ProbeSlaveID ¶
ProbeSlaveID discovers the correct slave ID for the device behind this dongle. It tries the currently configured slave ID first, then scans IDs 1 through maxID. A shorter timeout is used for probing. On success, the client's slave ID is set to the discovered ID and returned.
func (*Client) ReadRegisters ¶
ReadRegisters reads holding registers from the inverter.
func (*Client) ScanFrames ¶
ScanFrames reads V5 frames from the dongle stream and calls the callback for each valid MODBUS frame found. Returns when callback returns false or on error.
func (*Client) WriteMultipleRegisters ¶
WriteMultipleRegisters writes multiple contiguous registers.
Click to show internal directories.
Click to hide internal directories.