3 # This module impliments the protocal mode for a dx cluster
5 # Copyright (c) 1998 Dirk Koopman G1TLH
22 # this is how a pc connection starts (for an incoming connection)
23 # issue a PC38 followed by a PC18, then wait for a PC20 (remembering
24 # all the crap that comes between).
28 my $call = $self->call;
30 # set the channel sort
34 self->send_now('B',"0");
36 # do we have him connected on the cluster somewhere else?
39 $self->{state} = 'incoming';
43 # This is the normal pcxx despatcher
51 # This is called from inside the main cluster processing loop and is used
52 # for despatching commands that are doing some long processing job
57 my @chan = DXChannel->get_all();
60 foreach $chan (@chan) {
61 next if $chan->sort ne 'A';
63 # send a pc50 out on this channel
64 if ($t >= $chan->t + $main::pc50_interval) {
72 # finish up a pc context
80 # some active measures
86 $s = shift if ref $s; # if I have been called $self-> ignore it.
87 my @except = @_; # to all channels EXCEPT these (dxchannel refs)
88 my @chan = DXChannel->get_all();
91 L: foreach $chan (@chan) {
92 next if $chan->sort != 'A'; # only interested in ak1a channels
93 foreach $except (@except) {
94 next L if $except == $chan; # ignore channels in the 'except' list
96 chan->send($s); # send it
101 # All the PCxx generation routines
106 return "PC18^wot a load of twaddle^$main::myprot_version^~";
109 # send all the DX clusters I reckon are connected
112 my @list = DXNode->get_all();
116 foreach $list (@list) {
117 push @nodes, $list->call;
119 return "PC38^" . join(',', @nodes) . "^~";
124 my $n = DXUsers->count;
125 return "PC50^$main::mycall^$n^H99^";