utils

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AmsAddressToString

func AmsAddressToString(amsNetId string, adsPort uint16) string

Converts given AmsAddress struct to string "amsNetId:port"

func AmsNetIdStrToByteArray

func AmsNetIdStrToByteArray(s string) ([]byte, error)

AmsNetIDStrToByteArray converts an AmsNetId string to a byte array.

func ByteArrayToAmsNetIdStr

func ByteArrayToAmsNetIdStr(b []byte) string

ByteArrayToAmsNetIdStr converts a byte array to an AmsNetId string.

func DecodePlcStringBuffer

func DecodePlcStringBuffer(data []byte) string

Decodes provided []byte to PLC STRING

func DecodePlcWstringBuffer

func DecodePlcWstringBuffer(data []byte) string

Decodes provided []byte to PLC WSTRING using ucs2 encoding, also trims zeroes

func EncodeStringToPlcStringBuffer

func EncodeStringToPlcStringBuffer(str string) []byte

Encodes provided string to []byte as PLC STRING

func EncodeStringToPlcWstringBuffer

func EncodeStringToPlcWstringBuffer(str string) []byte

Encodes provided string to []byte as PLC WSTRING using ucs2 encoding

func TrimPlcString

func TrimPlcString(str string) string

Trims given PLC string until '\\0' is found (removes empty bytes from the end)

Types

This section is empty.

Jump to

Keyboard shortcuts

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