Net::Async::ArtNet - use ArtNet with IO::Async
Net::Async::ArtNet
IO::Async
use IO::Async::Loop; use Net::Async::ArtNet; my $loop = IO::Async::Loop->new; $loop->add( Net::Async::ArtNet->new( on_dmx => sub { my $self = shift; my ( $seq, $phy, $universe, $data ) = @_; return unless $phy == 0 and $universe == 0; my $ch10 = $data->[10 - 1]; # DMX channels are 1-indexed print "Channel 10 now set to: $ch10\n"; } ) ); $loop->run;
This object class allows you to use the Art-Net protocol with IO::Async. It receives Art-Net frames containing DMX data.
A new set of DMX control values has been received. $seq contains the sequence number from the packet, $phy and $uni the physical and universe numbers, and $data will be an ARRAY reference containing up to 512 DMX control values.
$seq
$phy
$uni
$data
The following named parameters may be passed to new or configure. Additionally, CODE references to set callbacks for events may be passed.
new
configure
Optional. getaddrinfo parameters to create socket listen for Art-Net packets on.
getaddrinfo
Synonym for service parameter.
service
http://en.wikipedia.org/wiki/Art-Net - Art-Net - Wikipedia
Paul Evans <leonerd@leonerd.org.uk>
To install Net::Async::ArtNet, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Net::Async::ArtNet
CPAN shell
perl -MCPAN -e shell install Net::Async::ArtNet
For more information on module installation, please visit the detailed CPAN module installation guide.