NAME
Ham::Packet::DXSpider - Receives DX Spots from the DXCluster
SYNOPSIS
# 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 collectin 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 );
DESCRIPTION
Sample session from dxspider
sp m1bsc
sp m1bsc
Enter Subject (30 characters):
m1bsc 145.450 13:00 5/9
m1bsc 145.450 13:00 5/9
Enter lines of text, /EX to send or /ABORT to exit
/ex
/ex
New mail has arrived for you
To ALL de 9A8A: LZ2HM: FB..here band closed, for now..?
Message no 3960 saved and directed to M1BSC
M1BSC de GB7EDX 3-Jun-2005 1022Z dxspider >
M1BSC de GB7EDX 3-Jun-2005 1022Z dxspider >
read
read
Msg: 3960 From: M1BSC Date: 3-Jun 1022Z Subj: m1bsc 145.450 13:00 5/9
M1BSC de GB7EDX 3-Jun-2005 1022Z dxspider >
DX de DK5IR: 18152.0 M3JIH c
1026Z JN49
DX de I5WEA: 7058.0 IV3/IK3SSW/P DCI-UD036 Op. TONY
1029Z JN53
DX de S51TA: 14013.2 EK0W/P FD
1023Z JN76
METHODS
constructor 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.
open() 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.
addStatsHandler( $codeRef ) 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.
addDXMessageHandler( $codeRef ) 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.
addPrivateMessageHandler( $codeRef ) 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.
start() Continuously polls the DXSPIDER for new events. Returns if the handle for the connection closes or becomes undefined for whatever reason.
poll()
Polls the DXSPIDER once for a new event. This will block until something is received and the current transaction is completed. TODOLProbably would be a candidate for a timeout when I get time.
sendPrivate( $to, $subject, $body )
Sends a private message to the callsign specified.
FUNCTIONS
Three functions are available for use as default handlers for testing and debugging purposes.
PREREQUISITES
Perl: 5.8.0
Moose
OSNAMES
Unix or Unix-likes.
AUTHOR
Bruce James - custard@cpan.org
VERSION
0.01