Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Header ¶
type Header struct {
// contains filtered or unexported fields
}
Header represents an EtherCAT frame header.
The header consists of 11 bits for length, 1 bit reserved, and 4 bits for the type.
----------------- EtherCat Header -----------------
| EcatType: 4bit | Reserved: 1bit | Length: 11bit |
---------------------------------------------------
func DefaultEcatHeader ¶
func DefaultEcatHeader() Header
DefaultEcatHeader creates and returns a default EtherCAT header with EcatType=1, Reserved=0, and Length=0.
Returns:
- EcatHeader: Default EtherCAT header
func NewEcatHeader ¶
NewEcatHeader creates a new EtherCAT header with the specified length. It returns an error if the provided length is outside the valid range [0, 2047].
Parameters:
- length (uint16): Length value for the EtherCAT header
Returns:
- EcatHeader: New EtherCAT header
- error: Error if length is outside the valid range
func (Header) ExtractLength ¶
ExtractLength returns the length value from the EtherCAT header.
Returns:
- uint16: Length value from the EtherCAT header