ethernetip

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: GPL-2.0, GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

Variables

This section is empty.

Functions

func NewEtherNetIPDriver

func NewEtherNetIPDriver() driver.Driver

Types

type ENIPClient

type ENIPClient = go_ethernet_ip.EIPTCP

type ENIPDecoder

type ENIPDecoder struct {
}

func NewENIPDecoder

func NewENIPDecoder() *ENIPDecoder

func (*ENIPDecoder) DecodeValue

func (d *ENIPDecoder) DecodeValue(data []byte, dataType string) (interface{}, error)

func (*ENIPDecoder) EncodeValue

func (d *ENIPDecoder) EncodeValue(value interface{}, dataType string) ([]byte, error)

func (*ENIPDecoder) ParseAddress

func (d *ENIPDecoder) ParseAddress(addr string) (*ENIPTag, error)

type ENIPScheduler

type ENIPScheduler struct {
	// contains filtered or unexported fields
}

func NewENIPScheduler

func NewENIPScheduler(transport *ENIPTransport, decoder *ENIPDecoder, cfg map[string]any) *ENIPScheduler

func (*ENIPScheduler) GetStats

func (s *ENIPScheduler) GetStats() (totalRequests, successCount, failureCount int64)

func (*ENIPScheduler) ReadPoints

func (s *ENIPScheduler) ReadPoints(ctx context.Context, points []model.Point) (map[string]model.Value, error)

func (*ENIPScheduler) WritePoint

func (s *ENIPScheduler) WritePoint(ctx context.Context, p model.Point, value interface{}) error

type ENIPTag

type ENIPTag struct {
	Name       string
	ArrayIndex int
	Path       []string
}

type ENIPTransport

type ENIPTransport struct {
	// contains filtered or unexported fields
}

func NewENIPTransport

func NewENIPTransport(cfg map[string]any) *ENIPTransport

func (*ENIPTransport) Connect

func (t *ENIPTransport) Connect(ctx context.Context) error

func (*ENIPTransport) Disconnect

func (t *ENIPTransport) Disconnect() error

func (*ENIPTransport) GetClient

func (t *ENIPTransport) GetClient() *ENIPClient

func (*ENIPTransport) GetConnectionMetrics

func (t *ENIPTransport) GetConnectionMetrics() (
	connectionSeconds int64,
	reconnectCount int64,
	localAddr string,
	remoteAddr string,
	lastDisconnectTime time.Time,
)

func (*ENIPTransport) GetRemoteAddr

func (t *ENIPTransport) GetRemoteAddr() string

GetRemoteAddr 返回远程地址

func (*ENIPTransport) IsConnected

func (t *ENIPTransport) IsConnected() bool

func (*ENIPTransport) NeedProbeCheck

func (t *ENIPTransport) NeedProbeCheck() bool

func (*ENIPTransport) ProbeConnection

func (t *ENIPTransport) ProbeConnection()

func (*ENIPTransport) RecordFailure

func (t *ENIPTransport) RecordFailure(err error)

func (*ENIPTransport) RecordSuccess

func (t *ENIPTransport) RecordSuccess()

type EtherNetIPDriver

type EtherNetIPDriver struct {
	// contains filtered or unexported fields
}

func (*EtherNetIPDriver) Connect

func (d *EtherNetIPDriver) Connect(ctx context.Context) error

func (*EtherNetIPDriver) Disconnect

func (d *EtherNetIPDriver) Disconnect() error

func (*EtherNetIPDriver) GetConnectionMetrics

func (d *EtherNetIPDriver) GetConnectionMetrics() (connectionSeconds int64, reconnectCount int64, localAddr string, remoteAddr string, lastDisconnectTime time.Time)

func (*EtherNetIPDriver) GetMetrics

func (d *EtherNetIPDriver) GetMetrics() model.ChannelMetrics

func (*EtherNetIPDriver) Health

func (d *EtherNetIPDriver) Health() driver.HealthStatus

func (*EtherNetIPDriver) Init

func (*EtherNetIPDriver) ReadPoints

func (d *EtherNetIPDriver) ReadPoints(ctx context.Context, points []model.Point) (map[string]model.Value, error)

func (*EtherNetIPDriver) SetDeviceConfig

func (d *EtherNetIPDriver) SetDeviceConfig(config map[string]any) error

func (*EtherNetIPDriver) SetSlaveID

func (d *EtherNetIPDriver) SetSlaveID(slaveID uint8) error

func (*EtherNetIPDriver) WritePoint

func (d *EtherNetIPDriver) WritePoint(ctx context.Context, p model.Point, value interface{}) error

type MockENIPClient

type MockENIPClient struct {
	// contains filtered or unexported fields
}

func (*MockENIPClient) Connect

func (m *MockENIPClient) Connect() error

func (*MockENIPClient) Disconnect

func (m *MockENIPClient) Disconnect() error

func (*MockENIPClient) Ping

func (m *MockENIPClient) Ping() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL