Versions in this module Expand all Collapse all v0 v0.2.1 Nov 7, 2026 Changes in this version type Identity + Major uint8 + Minor uint8 v0.2.0 Oct 11, 2026 Changes in this version + const ClassAssembly + const ClassSymbol + const ClassTemplate + const IOPort + const ItemSequencedAddress + const SvcGetAttributeList + const SvcGetInstanceAttributeList + func IOPacket(connID, encapSeq uint32, cipSeq uint16, data []byte) []byte + func ParseIOPacket(b []byte) (connID, encapSeq uint32, cipSeq uint16, data []byte, err error) type Client + func (c *Client) ListTags(ctx context.Context, program string) ([]TagInfo, error) + func (c *Client) OpenIO(ctx context.Context, cfg IOConfig) (*IOConn, error) + func (c *Client) ReadTemplate(ctx context.Context, instance uint16) (Template, error) + type IOConfig struct + AdapterUDPPort int + ConfigInstance uint16 + InputInstance uint16 + InputSize int + LocalUDP string + Multiplier byte + OutputInstance uint16 + OutputSize int + RPI time.Duration + type IOConn struct + func (io *IOConn) Close() + func (io *IOConn) Err() error + func (io *IOConn) Input() ([]byte, uint16, time.Time) + func (io *IOConn) SetOutput(b []byte) + func (io *IOConn) SetRun(run bool) + func (io *IOConn) WaitInput(ctx context.Context) ([]byte, error) + type TagInfo struct + Dims [3]int + Instance uint32 + Name string + ReadOnly bool + System bool + Template uint16 + Type Type + func (t TagInfo) Elements() int + type Template struct + Handle uint16 + Instance uint16 + Members []TemplateMember + Name string + Size int + func (t Template) DecodeStruct(b []byte, lookup func(instance uint16) (Template, bool)) (map[string]any, error) + type TemplateMember struct + Array int + Bit int + Hidden bool + Name string + Offset int + Template uint16 + Type Type v0.1.0 Oct 11, 2026 Changes in this version + const ClassConnectionManager + const ClassIdentity + const ClassMessageRouter + const CmdListIdentity + const CmdListInterfaces + const CmdListServices + const CmdNOP + const CmdRegisterSession + const CmdSendRRData + const CmdSendUnitData + const CmdUnRegisterSession + const DefaultConnSize + const DefaultPort + const HandleSTRING + const HeaderLen + const ItemConnectedAddress + const ItemConnectedData + const ItemIdentity + const ItemNullAddress + const ItemSockaddrOT + const ItemSockaddrTO + const ItemUnconnectedData + const ReplyBit + const StatusAttrNotSupported + const StatusConnFailure + const StatusEmbeddedError + const StatusNotEnoughData + const StatusNotSettable + const StatusObjectMissing + const StatusPartial + const StatusPathSegment + const StatusPathUnknown + const StatusReplyTooLarge + const StatusServiceNotSup + const StatusSuccess + const StatusTooMuchData + const StatusVendor + const StringChars + const StringSize + const SvcForwardClose + const SvcForwardOpen + const SvcGetAttributeSingle + const SvcGetAttributesAll + const SvcLargeForwardOpen + const SvcMultipleService + const SvcReadTag + const SvcReadTagFragmented + const SvcSetAttributeSingle + const SvcUnconnectedSend + const SvcWriteTag + const SvcWriteTagFragmented + const TypeBOOL + const TypeBYTE + const TypeDINT + const TypeDWORD + const TypeINT + const TypeLINT + const TypeLREAL + const TypeLWORD + const TypeREAL + const TypeSINT + const TypeStruct + const TypeUDINT + const TypeUINT + const TypeULINT + const TypeUSINT + const TypeWORD + func AtomicTypeCode(name string) (code uint16, ok bool) + func Decode(t Type, data []byte, elements int, members []Member) (any, error) + func DecodeAtomic(code uint16, b []byte) (any, error) + func DecodeString(b []byte) (string, error) + func Element(b []byte, i uint32) []byte + func EncapStatusText(s uint32) string + func Encode(t Type, v any, elements int) ([]byte, error) + func EncodeAtomic(code uint16, v any) ([]byte, error) + func EncodeString(s string) ([]byte, error) + func ExtStatusText(general byte, ext uint16) string + func IdentityItem(id Identity, major, minor uint8, serial uint32) []byte + func IsCIP(err error) bool + func Logical(class, instance uint16, attr int) []byte + func MarshalCPF(items ...Item) []byte + func MarshalResponse(service, status byte, ext []uint16, data []byte) []byte + func MultipleService(reqs [][]byte) []byte + func ParseRequest(b []byte) (service byte, path, data []byte, err error) + func ParseUnconnectedSend(b []byte) (msg, route []byte, err error) + func PortSegment(b []byte, port uint16, link string) ([]byte, error) + func RRData(timeout uint16, items ...Item) []byte + func RegisterSessionData() []byte + func Request(service byte, path, data []byte) []byte + func Route(s string) ([]byte, error) + func SplitMultiple(b []byte) ([][]byte, error) + func StatusText(s byte) string + func Symbolic(b []byte, name string) []byte + func TagPath(tag string) ([]byte, error) + type Client struct + Addr string + ConnSize int + Connected bool + KeepAlive time.Duration + Route []byte + Timeout time.Duration + func (c *Client) Close() + func (c *Client) Do(ctx context.Context, service byte, path, data []byte) (*Response, error) + func (c *Client) GetAttribute(ctx context.Context, class, instance uint16, attr int) ([]byte, error) + func (c *Client) Identity() *Identity + func (c *Client) ListIdentity(ctx context.Context) (*Identity, error) + func (c *Client) MaxMessage() int + func (c *Client) Mode() (string, error) + func (c *Client) ReadTag(ctx context.Context, tag string, elements int) (Type, []byte, error) + func (c *Client) ReadTags(ctx context.Context, reads []*TagRead) error + func (c *Client) SetAttribute(ctx context.Context, class, instance uint16, attr int, data []byte) error + func (c *Client) WriteTag(ctx context.Context, tag string, t Type, elements int, data []byte) error + type Error struct + Ext []uint16 + Service byte + Status byte + func (e *Error) Error() string + type Header struct + Command uint16 + Context [8]byte + Length uint16 + Options uint32 + Session uint32 + Status uint32 + func ParseHeader(b []byte) (Header, error) + func ReadPacket(r io.Reader) (Header, []byte, error) + func (h Header) Marshal(data []byte) []byte + type Identity struct + DeviceType uint16 + IP string + Port uint16 + ProductCode uint16 + ProductName string + Protocol uint16 + Revision string + Serial string + State uint8 + Status uint16 + Vendor uint16 + func Discover(ctx context.Context, addr string, wait time.Duration) ([]Identity, error) + func ParseIdentity(b []byte) (Identity, error) + func ParseListIdentity(b []byte) ([]Identity, error) + type Item struct + Data []byte + Type uint16 + func ParseCPF(b []byte) ([]Item, error) + func ParseRRData(b []byte) ([]Item, error) + type Member struct + Bit int + Name string + Offset int + Type string + type Response struct + Data []byte + Ext []uint16 + Service byte + Status byte + func ParseResponse(b []byte) (*Response, error) + func (r *Response) Err() error + func (r *Response) WriteErr() error + type TagRead struct + Data []byte + Elements int + Err error + Tag string + Type Type + type Type struct + Code uint16 + Handle uint16 + func ParseType(b []byte) (Type, []byte, error) + func ParseTypeName(s string) (Type, bool) + func (t Type) IsStruct() bool + func (t Type) Marshal() []byte + func (t Type) Name() string + func (t Type) Size() int