]> www.dxcluster.org Git - spider.git/blob - cmd/forward/opername.pl
1. Sort out PC41 handling to include type 5 records for QRA locators and also
[spider.git] / cmd / forward / opername.pl
1 #
2 # Cause node to send PC41 info frames
3 #
4 # Copyright (c) 1998 - Iain Philipps G0RDI
5 #
6 # Mods by Dirk Koopman G1TLH 12Dec98
7 #
8
9 my ($self, $line) = @_;
10 my @f = split /\s+/, uc $line;
11 my @out;
12
13 if ($self->priv < 1) {
14         if (@f == 0) {
15                 push @f, $self->call;
16         } else {
17                 return (1, $self->msg('e5'));
18         }
19 } elsif (@f == 0) {
20         return (1, $self->msg('e6'));
21 }
22
23 my $call;
24 foreach $call (@f) {
25         my $ref = DXUser->get_current($call);
26         if ($ref) {
27                 my $name = $ref->name;  
28                 my $qth = $ref->qth;
29                 my $lat = $ref->lat;
30                 my $long = $ref->long;
31                 my $node = $ref->homenode;
32                 my $qra = $ref->qra;
33                 my $latlong = DXBearing::lltos($lat, $long) if $lat && $long;
34                 if ($name) {
35                         my $l = DXProt::pc41($DXProt::me, $call, 1, $name);
36                         DXProt::eph_dup($l);
37                         DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
38                 }
39                 if ($qth) {
40                         my $l = DXProt::pc41($call, 2, $qth);
41                         DXProt::eph_dup($l);
42                         DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
43                 }
44                 if ($latlong) {
45                         my $l = DXProt::pc41($call, 3, $latlong);
46                         DXProt::eph_dup($l);
47                         DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
48                 }
49                 if ($node) {
50                         my $l = DXProt::pc41($call, 4, $node);
51                         DXProt::eph_dup($l);
52                         DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
53                 }
54                 if ($qra) {
55                         my $l = DXProt::pc41($call, 5, $qra);
56                         DXProt::eph_dup($l);
57                         DXProt::broadcast_all_ak1a($l, $DXProt::me) ;
58                 }
59         }
60 }
61
62 return (1, @out);