MODULA - M2PROT.ZIP - QCCOMM.DEF

 
Output of file : QCCOMM.DEF contained in archive : M2PROT.ZIP

(*# call(o_a_copy => off) *)
(*%F _fdata *)
(*# call(seg_name => null) *)
(*%E *)
(*# module(implementation=>on) *)
(*# data(seg_name => null) *)
DEFINITION MODULE QCcomm;

(* NOTE: THIS IS AN ABRIDGED VERSION OF QCcomm TO DEFINE PROCEDURES *)
(* USED IN FILE TRANSFER PROTOCOLS *)

(* This JPI Modula-2 module is part of *)

(* QC -- a communications program *)
(* by Carl Neiburger *)
(* 169 N. 25th St.*)
(* San Jose, Calif. 95116 *)

(* CompuServe No. 72336,2257 *)


CONST
soh = 01; stx = 02H; etx = 03H; eot = 04H;
enq = 05; ack = 06H; bs = 10C; lf = 12C;
cr = 15C; dle = 10H; xon = 11H; xoff = 13H;
nak = 15H; syn = 16H; can = 18H; sub = 1AH;
esc = 33B; cee = 43H;

ComTimedOut = 0FFFEH; (* These "non-characters " *)
ComNoCarrier = 0FFFDH; (* Can be returned by *)
ComAbort = 0FFFCH; (* CommRdData and CommRdDataTest *)

ProgramName = 'QC'; (* for transfer protocol IDs *)

PROCEDURE CommWrData(ch : BYTE);
(* Writes a byte to communications port *)

PROCEDURE CommWrStr( s : ARRAY OF CHAR ): CARDINAL;
(* Writes a string to communications port *)
(* returns checksum *)

PROCEDURE CommRdData(waitTime:CARDINAL ) : CARDINAL;
(* Reads a byte from communications port *)
(* If available within waitTime seconds, returns character *)
(* If none is available, returns CommTimedOut *)
(* If none is available immediately, checks for abort request by
scanning keyboard. If abort key is pressed, returns ComAbort *)
(* If carrier detect is off, returns ComNoCarrier *)

PROCEDURE CommRdDataTest(waitTime:CARDINAL ) : CARDINAL;
(* Same as CommRdData but checks for abort key before checking communications
port. This makes it slower than CommRdData. It should be called only
occasionally, say, at the start of each packet, to monitor for abort
requests. *)

(* Note: CommWrData, CommRdData and CommRdDataTest all update
QCdisp.DataRegisters[TotalBytes, Receiving]
where Receiving is TRUE for reads and false for writes *)

PROCEDURE setXon( TransmitOn, ReceiveOn : BOOLEAN);
(* For communications drivers that automatically detect Xon and Xoff,
this turns the auto-detect system on and off for Xon transmission and
reception. They must be off (FALSE) for XModem, XModem-1K, Telink and
YModem transfers. Other protocols are capable of handling Xon-Xoff,
although BPlus requires use of the DQextended quote set. Otherwise,
BPlus will miss Xon and Xoff characters with the eighth bit set. *)

END QCcomm.