Ham::Packet::DXSpider - Receives DX Spots from the DXCluster
# Construct object using address and optional port my $dx=Ham::Packet::DXSpider->new( callsign => 'your callsign', address => 'dxcluster address', port => 'port', ); # Construct object using supplied IO::Handle my $dx=Ham::Packet::DXSpider->new( callsign => 'your callsign', handle => IO::Handle ); # Set a handler for received private messages $dx->addPrivateMessageHandler( sub { my %args=@_; my $from= $args{from} || ''; my $to= $args{to} || ''; my $body= $args{body} || 'no message'; my $subject= $args{subject} || 'no subject'; my $time= $args{time} || gmtime(time()); } ); # Set a handler for received DX messages $dx->addDXMessageHandler( sub { my %args=@_; my $from= $args{from}; my $frequency= $args{frequency}; my $message= $args{message}; my $heard= $args{heard}; my $time= $args{time}; my $locator= $args{locator}; } ); # Add a handler for collecting statistics on DX spots received. $dx->addStatsHandler( sub { my %args=@_; my $from= $args{from}; my $freq= $args{frequency}; my $message= $args{message}; my $heard= $args{heard}; my $time= $args{time}; my $locator= $args{locator}; } ); # Send a message $dx->sendPrivate( $to, $subject, $message ); $dx->start();
new( callsign => 'your callsign', address => 'dxcluster address', port => 'port', handle => IO::Handle );
Create a new DXSpider object for the specified callsign. If address and optionally port are specified, this will also open the connection to the DXSPIDER server.
Address can also be an already open IO::Handle object, in which case port becomes meaningless.
Moose builder. Called after construction. Opens the handle if necessary.
Opens a connection to a DXSPIDER server located at the address and port specified. Address can also be an already open IO::Handle object, in which case port becomes meaningless.
Adds a code reference to a function that can be used to collect statistics of the received DX spot messages. Only DX spot messages will be sent to this handler.
Handlers are added to a list and will be called in turn when a new DX spot message arrives.
Adds a code reference to a function that handles DX spot messages. Handlers are added to a list and will be called in turn when a DX spot message arrives.
Adds a code reference to a function that handles Private messages directed to the logged in callsign. Handlers are added to a list and will be called in turn when a new message arrives.
Continuously polls the DXSPIDER for new events. Returns if the handle for the connection closes or becomes undefined for whatever reason.
Polls the DXSPIDER once for a new event. This will block until something is received and the current transaction is completed.
TODO: Probably would be a candidate for a timeout when I get time.
Sends a private message to the callsign specified.
Three functions are available for use as default handlers for testing and debugging purposes.
Unix or Unix-likes.
Bruce James - custard@cpan.org
0.04
Copyright 2012, Bruce James
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Ham::Packet::DXSpider, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ham::Packet::DXSpider
CPAN shell
perl -MCPAN -e shell install Ham::Packet::DXSpider
For more information on module installation, please visit the detailed CPAN module installation guide.