2771bbe4441489ec4015449922d823b13491599d
[spider.git] / perl / Local.pm
1 #
2 # This is a template Local module
3 #
4 # DON'T CHANGE THIS, copy it to ../local/ and change it
5 # there
6 #
7 # You can add whatever code you like in here, you can also declare
8 # new subroutines in addition to the ones here, include other packages
9 # or do whatever you like. This is your spring board.
10 #
11
12 package Local;
13
14 use DXVars;
15 use DXDebug;
16 use DXUtil;
17
18 # DON'T REMOVE THIS LINE
19 use strict;
20
21
22 # declare any global variables you use in here
23 use vars qw{ };
24
25 # called at initialisation time
26 sub init
27 {
28
29 }
30
31 # called once every second
32 sub process
33 {
34
35 }
36
37 # called just before the ending of the program
38 sub finish
39 {
40
41 }
42
43 # called after an incoming PC line has been split up, return 0 if you want to
44 # continue and 1 if you wish the PC Protocol line to be ignored completely
45 #
46 # Parameters:-
47 # $self      - the DXChannel object 
48 # $pcno      - the no of the PC field
49 # @field     - the spot exactly as is, split up into fields
50 #              $field[0] will be PC11 or PC26 
51 sub pcprot
52 {
53         return 0;            # remove this line if you want the switch
54
55         my ($self, $pcno, @field) = @_;
56         
57         # take out any switches that aren't interesting to you.
58  SWITCH: {
59                 if ($pcno == 10) {              # incoming talk
60                         last SWITCH;
61                 }
62                 
63                 if ($pcno == 11 || $pcno == 26) { # dx spot
64                         last SWITCH;
65                 }
66                 
67                 if ($pcno == 12) {              # announces
68                         last SWITCH;
69                 }
70                 
71                 if ($pcno == 13) {
72                         last SWITCH;
73                 }
74                 if ($pcno == 14) {
75                         last SWITCH;
76                 }
77                 if ($pcno == 15) {
78                         last SWITCH;
79                 }
80                 
81                 if ($pcno == 16) {              # add a user
82                         last SWITCH;
83                 }
84                 
85                 if ($pcno == 17) {              # remove a user
86                         last SWITCH;
87                 }
88                 
89                 if ($pcno == 18) {              # link request
90                         last SWITCH;
91                 }
92                 
93                 if ($pcno == 19) {              # incoming cluster list
94                         last SWITCH;
95                 }
96                 
97                 if ($pcno == 20) {              # send local configuration
98                         last SWITCH;
99                 }
100                 
101                 if ($pcno == 21) {              # delete a cluster from the list
102                         last SWITCH;
103                 }
104                 
105                 if ($pcno == 22) {
106                         last SWITCH;
107                 }
108                 
109                 if ($pcno == 23 || $pcno == 27) { # WWV info
110                         last SWITCH;
111                 }
112                 
113                 if ($pcno == 24) {              # set here status
114                         last SWITCH;
115                 }
116                 
117                 if ($pcno == 25) {      # merge request
118                         last SWITCH;
119                 }
120                 
121                 if (($pcno >= 28 && $pcno <= 33) || $pcno == 40 || $pcno == 42 || $pcno == 49) { # mail/file handling
122                         last SWITCH;
123                 }
124                 
125                 if ($pcno == 34 || $pcno == 36) { # remote commands (incoming)
126                         last SWITCH;
127                 }
128                 
129                 if ($pcno == 35) {              # remote command replies
130                         last SWITCH;
131                 }
132                 
133                 if ($pcno == 37) {
134                         last SWITCH;
135                 }
136                 
137                 if ($pcno == 38) {              # node connected list from neighbour
138                         last SWITCH;
139                 }
140                 
141                 if ($pcno == 39) {              # incoming disconnect
142                         last SWITCH;
143                 }
144                 
145                 if ($pcno == 41) {              # user info
146                         last SWITCH;
147                 }
148                 if ($pcno == 43) {
149                         last SWITCH;
150                 }
151                 if ($pcno == 44) {
152                         last SWITCH;
153                 }
154                 if ($pcno == 45) {
155                         last SWITCH;
156                 }
157                 if ($pcno == 46) {
158                         last SWITCH;
159                 }
160                 if ($pcno == 47) {
161                         last SWITCH;
162                 }
163                 if ($pcno == 48) {
164                         last SWITCH;
165                 }
166                 
167                 if ($pcno == 50) {              # keep alive/user list
168                         last SWITCH;
169                 }
170                 
171                 if ($pcno == 51) {              # incoming ping requests/answers
172                         last SWITCH;
173                 }
174         }
175         return 0;
176 }
177
178 # called after the spot has been stored but before it is broadcast,
179 # you can do funky routing here that is non-standard. 0 carries on
180 # after this, 1 stops dead and no routing is done (this could mean
181 # that YOU have done some routing or other instead
182 #
183 # Parameters:-
184 # $self      - the DXChannel object 
185 # $freq      - frequency
186 # $spotted   - the spotted callsign
187 # $d         - the date in unix time format
188 # $text      - the text of the spot
189 # $spotter   - who spotted it
190 # $orignode  - the originating node
191
192 sub spot
193 {
194         return 0;
195 }
196
197 # called after the wwv has been stored but before it is broadcast,
198 # you can do funky routing here that is non-standard. 0 carries on
199 # after this, 1 stops dead and no routing is done (this could mean
200 # that YOU have done some routing or other instead
201 #
202 # Parameters:-
203 # $self      - the DXChannel object 
204 # The rest the same as for Geomag::update 
205 sub wwv
206 {
207         return 0;
208 }
209
210 # same for wcy broadcasts
211 sub wcy
212 {
213         return 0;
214 }
215
216 # no idea what or when these are called yet
217 sub userstart
218 {
219         return 0;
220 }
221
222 sub userline
223 {
224         return 0;
225 }
226
227 sub userfinish
228 {
229         return 0;
230 }
231 1;
232 __END__