artnet

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 7 Imported by: 1

README

ArtNet

Simple Art-Net parser for Golang. WIP.

Parses ArtDmx, ArtPoll, and ArtPollReply packets, receive-only

Tested using Chamsys MagicQ for PC.

Windows fix

Add following line to go.mod, in package using this:

replace github.com/projecthunt/reuseable => github.com/xmapst/reuseable v0.0.0-20220729041713-16fb23d1c9ef

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArtNet

type ArtNet struct {
	Type        string
	OpCode      OpCode
	ProtocolVer uint16
	Sequence    uint8
	Physical    uint8
	Port        uint16
	Length      uint16
	Data        [512]uint8
	Pool        ArtNetPoll
	PoolReply   ArtNetPollReply
	Source      net.Addr
	HasChannels bool
}

func GetAndParse

func GetAndParse(debug bool) (ArtNet, error)

func Parse

func Parse(buf []byte, n int, addr net.Addr, plog bool) (ArtNet, error)

func (ArtNet) Channel

func (an ArtNet) Channel(n uint) (uint8, bool)

func (ArtNet) ChannelsAsSlice

func (an ArtNet) ChannelsAsSlice(from, amount int) []uint8

func (ArtNet) ChannelsAsSliceOfStrings

func (an ArtNet) ChannelsAsSliceOfStrings(from, amount int) []string

func (ArtNet) ChannelsAsString

func (an ArtNet) ChannelsAsString(from, amount int, delim string) string

type ArtNetPoll

type ArtNetPoll struct {
	Priority       uint8
	TxDiagOnChange bool
	TxDiag         bool
	TxDiagUnicast  bool
	TxVLC          bool
}

func (ArtNetPoll) ExplainFlags

func (anp ArtNetPoll) ExplainFlags() []string

type ArtNetPollReply

type ArtNetPollReply struct {
	IPAddress []uint8
	Version   []uint8
	OEM       []uint8
	Name      string
	LongName  string
	Status    string
}

func (ArtNetPollReply) IP

func (apr ArtNetPollReply) IP() string

type OpCode

type OpCode uint16
const (
	OPCODEPOOL      OpCode = 0x20
	OPCODEPOOLREPLY OpCode = 0x21
	OPCODECHANNELS  OpCode = 0x50
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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