projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
wsjtl WIP
[spider.git]
/
perl
/
wsjtl.pl
diff --git
a/perl/wsjtl.pl
b/perl/wsjtl.pl
old mode 100644
(file)
new mode 100755
(executable)
index
2fabfe9
..
8915a2c
--- a/
perl/wsjtl.pl
+++ b/
perl/wsjtl.pl
@@
-1,4
+1,4
@@
-#!/usr/binenv perl
+#!/usr/bin
/
env perl
#
# A basic listener and decoder of wsjtx packets
#
#
# A basic listener and decoder of wsjtx packets
#
@@
-70,7
+70,7
@@
use DXUDP;
use WSJTX;
use WSJTX;
-our $udp_host = '
0.0.0.0
';
+our $udp_host = '
::
';
our $udp_port = 2237;
our $tcp_host = '::';
our $tcp_port = 2238;
our $udp_port = 2237;
our $tcp_host = '::';
our $tcp_port = 2238;
@@
-84,16
+84,31
@@
our %slot; # where the connected TCP client structures live
dbginit('wsjtl');
dbginit('wsjtl');
-dbgadd('udp');
+
+
$uh = DXUDP->new;
$uh->start(host => $udp_host, port => $udp_port) or die "Cannot listen on $udp_host:$udp_port $!\n";
$uh = DXUDP->new;
$uh->start(host => $udp_host, port => $udp_port) or die "Cannot listen on $udp_host:$udp_port $!\n";
-$wsjtx = WSJTX->new();
-$uh->on(read =>
sub {wstjx->handle(@_)}
);
+$wsjtx = WSJTX->new(
handle=>'2,5'
);
+$uh->on(read =>
\&_read
);
Mojo::IOLoop->start() unless Mojo::IOLoop->is_running;
Mojo::IOLoop->start() unless Mojo::IOLoop->is_running;
+sub _read
+{
+ my ($handle, $data) = @_;
+
+# say "before handle";
+
+ $wsjtx->handle($handle, $data);
+
+# say "after handle";
+
+# my $lth = length $data;
+# dbgdump('udp', "UDP IN lth: $lth", $data);
+}
+
exit;
exit;