Documentation ¶
Overview ¶
Package command provides communication patterns for Goodwe inverters using the Modbus protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AA55Command ¶
type AA55Command struct {
// contains filtered or unexported fields
}
func NewAA55 ¶
func NewAA55(payload, responseType string) (*AA55Command, error)
func (AA55Command) String ¶
func (cmd AA55Command) String() string
func (AA55Command) ValidateResponse ¶
func (cmd AA55Command) ValidateResponse(p []byte) ([]byte, error)
type FailureCode ¶
type FailureCode byte
const ( FailureCodeIllegalFunction FailureCode = iota + 1 FailureCodeIllegalDataAddress FailureCodeIllegalDataValue FailureCodeSlaveDeviceFailure FailureCodeAcknowledge FailureCodeSlaveDeviceBusy FailureCodeNegativeAcknowledgement FailureCodeMemoryParityError FailureCodeGatewayTargetDeviceFailedToRespond )
func (FailureCode) String ¶
func (i FailureCode) String() string
type ModbusCommand ¶
type ModbusCommand struct {
// contains filtered or unexported fields
}
func NewModbus ¶
func NewModbus(commandType ModbusCommandType, offset uint16, value uint16) *ModbusCommand
func (ModbusCommand) String ¶
func (cmd ModbusCommand) String() string
func (ModbusCommand) ValidateResponse ¶
func (cmd ModbusCommand) ValidateResponse(p []byte) ([]byte, error)
ValidateResponse validates the entire response and if valid returns the response body.
type ModbusCommandType ¶
type ModbusCommandType byte
const ( ModbusCommandTypeRead ModbusCommandType = 0x03 // TODO: implement write commands. ModbusCommandTypeWrite ModbusCommandType = 0x06 ModbusCommandTypeWriteMulti ModbusCommandType = 0x10 )
Click to show internal directories.
Click to hide internal directories.