ethercat

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EtherCAT

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

ecat represents an EtherCAT packet.

func NewEtherCAT

func NewEtherCAT() *EtherCAT

NewEcat creates and returns a new EtherCAT packet with a default header and an empty list of datagrams.

Returns:

  • ecat: New EtherCAT packet

func (*EtherCAT) AppendDatagram

func (e *EtherCAT) AppendDatagram(data datagram.Datagram) error

AppendDatagram appends a new EtherCAT datagram to the packet and updates the packet header(Length). It returns an error if the new header length exceeds the valid range.

Parameters:

  • data (datagram.EcatDatagram): EtherCAT datagram to append

Returns:

  • error: Error if the new header length exceeds the valid range

func (EtherCAT) Bytes

func (e EtherCAT) Bytes() []byte

Bytes returns the byte representation of the EtherCAT packet, including the header and datagrams.

Returns:

  • []byte: Byte representation of the EtherCAT packet

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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