projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
26a25e6
)
get wsjtx to work
author
Dirk Koopman
<djk@tobit.co.uk>
Sun, 13 Sep 2020 13:10:27 +0000
(14:10 +0100)
committer
Dirk Koopman
<djk@tobit.co.uk>
Sun, 13 Sep 2020 13:10:27 +0000
(14:10 +0100)
perl/WSJTX.pm
patch
|
blob
|
history
perl/wsjtl.pl
patch
|
blob
|
history
diff --git
a/perl/WSJTX.pm
b/perl/WSJTX.pm
index 389b8b2193a50275282e91f48ce428156e0488b9..16f7b64a8055ba8db031f9197042426922c59f57 100644
(file)
--- a/
perl/WSJTX.pm
+++ b/
perl/WSJTX.pm
@@
-10,16
+10,23
@@
use warnings;
use 5.22.1;
use JSON;
use 5.22.1;
use JSON;
+use DXDebug;
my $json;
my $json;
+sub new
+{
+ return bless {}, 'WSJTX';
+}
+
sub handle
{
my ($self, $handle, $data) = @_;
my $lth = length $data;
dbgdump('udp', "UDP IN lth: $lth", $data);
sub handle
{
my ($self, $handle, $data) = @_;
my $lth = length $data;
dbgdump('udp', "UDP IN lth: $lth", $data);
-
+ return 1;
+
}
sub finish
}
sub finish
diff --git
a/perl/wsjtl.pl
b/perl/wsjtl.pl
index 2fabfe9ed95cb335a514a466a43a283124134306..e6f1c0482f0cbe65d8495f4cf16996e8d7946e33 100644
(file)
--- a/
perl/wsjtl.pl
+++ b/
perl/wsjtl.pl
@@
-71,7
+71,7
@@
use DXUDP;
use WSJTX;
our $udp_host = '0.0.0.0';
use WSJTX;
our $udp_host = '0.0.0.0';
-our $udp_port = 2237;
+our $udp_port =
59387; #
2237;
our $tcp_host = '::';
our $tcp_port = 2238;
our $tcp_host = '::';
our $tcp_port = 2238;
@@
-89,11
+89,25
@@
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;
+$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;