Documentation
¶
Overview ¶
Package artnet attempts to implement the Art-Net 4 specification from (c) Artistic Licence Holding Ltd, available at www.Art-Net.org.uk. Art-Net is an Ethernet protocol based on the TCP/IP protocol suite. Its purpose is to allow transfer of large amounts of DMX512 data over a wide area using standard networking technology.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ArtPollReplyFromConfig ¶
func ArtPollReplyFromConfig(c NodeConfig) *packet.ArtPollReplyPacket
ArtPollReplyFromConfig will return a ArtPollReplyPacket from the NodeConfig TODO: make this a more complete packet by adding the other NodeConfig fields
Types ¶
type Address ¶
Address contains a universe address
type ControlledNode ¶
type ControlledNode struct { LastSeen time.Time Node NodeConfig UDPAddress net.UDPAddr Sequence uint8 DMXBuffer map[Address]*dmxBuffer // contains filtered or unexported fields }
ControlledNode hols the configuration of a node we control
type Controller ¶
type Controller struct { // Nodes is a slice of nodes that are seen by this controller Nodes []*ControlledNode OutputAddress map[Address]*ControlledNode InputAddress map[Address]*ControlledNode // contains filtered or unexported fields }
Controller holds the information for a controller
func NewController ¶
NewController return a Controller
func (*Controller) SendDMXToAddress ¶
func (c *Controller) SendDMXToAddress(dmx [512]byte, address Address)
SendDMXToAddress will set the DMXBuffer for a destination address and update the node
func (*Controller) SetOption ¶
func (c *Controller) SetOption(option Option) error
SetOption runs a functional option against Controller.
type Fields ¶
type Fields map[string]interface{}
Fields are a representation of formatted log fields
type Logger ¶
Logger is the interface for a logger
func NewDefaultLogger ¶
func NewDefaultLogger() Logger
NewDefaultLogger returns a Logger based on logrus
type Node ¶
type Node struct { // Config holds the configuration of this node Config NodeConfig // contains filtered or unexported fields }
Node is the information known about a node
func (*Node) Connection ¶
func (*Node) DeregisterCallback ¶
DeregisterCallback deletes a callback stored for the given opcode. This deregistration function can only deregister callbacks before the node has been started.
func (*Node) RegisterCallback ¶
func (n *Node) RegisterCallback(opcode code.OpCode, callback NodeCallbackFn)
RegisterCallback stores the given callback which will be called when a packet with the given opcode arrives. This registration function can only register callbacks before the node has been started. Calling this function multiple times replaces every previous callback.
func (*Node) SetOption ¶
func (n *Node) SetOption(option NodeOption) error
SetOption runs a functional option against Node.
type NodeCallbackFn ¶
type NodeCallbackFn func(p packet.ArtNetPacket)
NodeCallbackFn gets called when a new packet has been received and needs to be processed
type NodeConfig ¶
type NodeConfig struct { OEM uint16 Version uint16 BiosVersion uint8 Manufacturer string Type code.StyleCode Name string Description string Ethernet net.HardwareAddr IP net.IP BindIP net.IP BindIndex uint8 Port uint16 Report []code.NodeReportCode Status1 code.Status1 Status2 code.Status2 BaseAddress Address InputPorts []InputPort OutputPorts []OutputPort }
NodeConfig is a representation of a single node.
func ConfigFromArtPollReply ¶
func ConfigFromArtPollReply(p packet.ArtPollReplyPacket) NodeConfig
ConfigFromArtPollReply will return a Config from the information in the ArtPollReplyPacket
func (NodeConfig) NumberOfPorts ¶
func (c NodeConfig) NumberOfPorts() uint16
NumberOfPorts returns the count of node ports. This method assumes that NodeConfig is validated.
func (NodeConfig) PortTypes ¶
func (c NodeConfig) PortTypes() [4]code.PortType
PortType merges the InputPorts and OutputPorts config into a single PortTypes definition. This method assumes that NodeConfig is validated.
type NodeOption ¶
NodeOption is a functional option handler for Node.
func NodeBroadcastAddress ¶
func NodeBroadcastAddress(addr net.UDPAddr) NodeOption
NodeBroadcastAddress sets the broadcast address to use; defaults to 2.255.255.255:6454
func NodeListenAddress ¶
func NodeListenAddress(addr net.UDPAddr) NodeOption
NodeListenAddress sets the listen address and port to use; defaults to :6454 if unset
func NodeListenIP ¶
func NodeListenIP(ip net.IP) NodeOption
NodeListenIP sets the listen IP to use; defaults to :6454 if unset
type Option ¶
type Option func(*Controller) error
Option is a functional option handler for Controller.
func BroadcastAddr ¶
BroadcastAddr sets the broadcast address to use; defaults to 2.255.255.255:6454
func ListenAddress ¶
ListenAddr sets the listen address and port to use; defaults to :6454 if unset
type OutputPort ¶
type OutputPort struct { Address Address Type code.PortType Status code.GoodOutput }
OutputPort contains information for an input port
Directories
¶
Path | Synopsis |
---|---|
example
|
|
Package packet contains the ArtNet packet definitions
|
Package packet contains the ArtNet packet definitions |
code
Package code contains codes used in ArtNet packets
|
Package code contains codes used in ArtNet packets |
Package version implements the version of the protocol
|
Package version implements the version of the protocol |