home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Columbia Kermit
/
kermit.zip
/
pub
/
scripts
/
ckermit
/
alphapage6
< prev
next >
Wrap
Text File
|
2020-01-01
|
4KB
|
105 lines
; File ALHAPAGE
;
; Authors: F. da Cruz and C. Gianone, Columbia University, September 1996.
;
; For use with C-Kermit 6.0.192 or later.
; For a detailed explanation, consult "Using C-Kermit", 2nd Ed., pp.454-456.
;
; Revised July 1997:
; 1. To make TAPMSG fit into 1K for small C-Kermit versions.
; 2. Change END to STOP within SWITCH to work around bug
; (these should be changed back to END in C-Kermit 6.0.193).
;
; TAPMSG, defined below, is an alphanumeric pager dialing script that
; implements the TAP protocol for sending one-line alphanumeric pages.
; To use the script, save it into a file, then tell C-Kermit to "take"
; the file. Now you have the TAPMSG macro defined. It assumes you have
; already made the phone connection. Then invoke it with two arguments:
; the pager ID and the message.
;
; Of course, it is also easy to define a macro for making the connection and
; then sending the page, for example (just a sample, change as required):
define APAGE {
set modem type usr ; I have a USR modem
set port com1 ; on COM1
set speed 1200 ; Must use 2400 bps for paging
set parity even ; and even parity
set flow xon/xoff ; and Xon/Xoff flow control
set modem flow none ; end-to-end, not local
set dial retries 10 ; Allow 10 redials
dial 5554321 ; Call the pager service
if success - ; If the call is answered
tapmsg \%1 {\%2} ; Send the page
else end 1 Page failed. ; otherwise fail
}
; To invoke the APAGE macro, put it in a file, edit it as necessary for your
; setup, tell C-Kermit to "take" the file, and then just type:
;
; apage number { this is a message }
;
; at the C-Kermit> prompt, for example:
;
; apage 99997654321 { Please call the office }
;
; Note: the pager ID number should not contain any spaces or else you must
; enclose it in braces:
;
; apage { 999 76 543 21 } { this is a message }
;
; Ditto for the message.
COMMENT - TAPMSG - Send a one-line alpha page using TAP
; \%1 = Pager ID
; \%2 = Message
;
def TAPMSG {
loc \%i \%m \%s blk ; Local variables
asg \%m \2\%1\13\%2\13\3 ; <STX>ID<CR>msg<CR><ETX>
asg \%s \fchecks(\%m) ; Get checksum and make block
asg blk \%m\fchar(\fmod(\%s/256,16)+48)-
\fchar(\fmod(\%s/16,16)+48)-
\fchar(\fmod(\%s,16)+48)\13 ; Checksummed TAP block
for \%i 1 6 1 { ; Try six times to get prompt
out \13 ; Send <CR>
in 3 ID= ; Wait for "ID="
if succ break
}
if > \%i 6 end 1 No prompt
for \%i 1 8 1 { ; Send <ESC>PG1, get <ACK>
msl 500
out \{27}PG1\13
min 3 {\6\13} {\21\13} {ID=} {\27\4\13}
switch \v(minput) {
:0, continue ; Timeout
:1, break ; <ACK>
:2, continue ; <NAK>
:3, out \{27}PG1\13, continue
:4, stop 1 Forced disconnect ; Fatal error
}
break
}
if > \%i 8 end 1 Timeout or bad response
in 5 \27[p\13 ; Wait for go-ahead
if fail end 1 No go-ahead ; Didn't get it
for \%i 1 8 1 { ; Try eight times
msl 500
out \m(blk) ; Send block
min 8 {\6\13} {\21\13} {\13\27\4\13} {\30\13}
switch \v(minput) { ; Get response
:0, continue ; Timeout
:1, break ; <ACK> - success
:2, continue ; <NAK>
:3, stop 1 Forced disconnect
:4, echo ERROR - RETRYING, continue
}
out \4\13 ; Sign off with <EOT>
in 5 \27\4\13 ; Get <ESC><EOT> back
break ; But ignore timeout
}
if > \%i 8 end 1 Timeout or bad response
}
; (End)