(FILECREATED "25-Feb-85 19:01:01" {ERIS}<SPEECH>MAILREADER>TALK.;4 5695   

      previous date: "17-Jan-85 14:32:07" {ERIS}<SPEECH>MAILREADER>TALK.;3)


(PRETTYCOMPRINT TALKCOMS)

(RPAQQ TALKCOMS [(FNS CLEAR.PROSE P.ESC.SEQ P.READBUFFER P.RESET PHONEMEMODE PROSE.COMMENCE.OUTPUT 
		      PROSE.ESC.SEQ PROSE.RESET PROSE.STOP READPORT RESET.PROSE SAY)
		 (DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS (ADDVARS (NLAMA)
										       (NLAML)
										       (LAMA 
											P.ESC.SEQ])
(DEFINEQ

(CLEAR.PROSE
  [LAMBDA NIL                                                (* mmw: "20-Sep-84 21:37")
    (RS232CLEARBUFFER (QUOTE BOTH))
    (for BYTE in (LIST 27 (CHCON1 (QUOTE %[))
		       (CHCON1 (QUOTE C)))
       do (RS232WRITEBYTE BYTE T) finally (PROGN (RS232WRITEBYTE 18)
						 (RS232FORCEOUTPUT])

(P.ESC.SEQ
  [LAMBDA args                                               (* pkh: "22-Oct-84 11:28")
    (PROG NIL                                                (* RS232WRITEBYTE 27)
                                                             (* RS232WRITECHARS (QUOTE %[))
          (for i from 2 to (SUB1 args)
	     do (PRINT (MKSTRING (ARG args i)))
		(PRINT (QUOTE ;)))
          [COND
	    ((IGEQ args 2)
	      (PRINT (MKSTRING (ARG args args]
          (PRINT (ARG args 1)
		 T])

(P.READBUFFER
  [LAMBDA NIL                                                (* mmw: "19-Oct-84 17:09")
                                                             (* Read RS232 input buffer until it is empty, find what
							     characters the bytes correspond to and return them as a
							     string)
    (for X while (SETQ X (RS232READBYTE)) collect X finally (RETURN (PACK (for X in $$VAL
									     collect (CHARACTER
										       X])

(P.RESET
  [LAMBDA (PRINTOUT)                                         (* pkh: "21-Nov-84 10:28")
    (RS232WRITEBYTE 18 T)                                    (* Sending <DC2>)
    (BLOCK 6000)
    (COND
      (PRINTOUT (printout T "Prose returned: " (P.READBUFFER)
			  T])

(PHONEMEMODE
  [LAMBDA (ON/OFF)                                           (* mmw: "20-Sep-84 15:36")

          (* * comment)


    (PROG (OUTPUTBYTES)
          (RS232WRITEBYTE 27)
          (RS232WRITEBYTE 91)
          (if (EQ ON/OFF (QUOTE ON))
	      then (RS232WRITECHARS "1I")
	    elseif (RS232WRITECHARS "0I"))
          (for BYTE in OUTPUTBYTES do (RS232WRITEBYTE BYTE T) finally (RS232FORCEOUTPUT))
          (RS232FORCEOUTPUT)
          (RETURN (READPORT])

(PROSE.COMMENCE.OUTPUT
  [LAMBDA NIL                                                (* mmw: "19-Oct-84 16:48")

          (* * comment)


    (RS232WRITEBYTE 27)
    (RS232WRITECHARS "[C" T])

(PROSE.ESC.SEQ
  [LAMBDA (SEQUENCE)                                         (* edited: "17-Jan-85 14:27")
    (RS232WRITEBYTE 27)
    (RS232WRITEBYTE 91)
    (RS232WRITECHARS SEQUENCE)
    (RS232FORCEOUTPUT])

(PROSE.RESET
  [LAMBDA NIL                                                (* pkh: "21-Nov-84 10:28")
    (RS232CLEARBUFFER (QUOTE BOTH))
    (RS232WRITEBYTE 18 T)
    (printout T "Waiting for 6 secs.......")
    (BLOCK 6000)
    (printout T T "Prose returned:  " (P.READBUFFER)
	      T])

(PROSE.STOP
  [LAMBDA NIL                                                (* mmw: "20-Sep-84 21:52")
    (PROSE.ESC.SEQ (QUOTE S])

(READPORT
  [LAMBDA NIL                                                (* pkh: "21-Nov-84 12:02")
    (for BYTE while [NOT (NULL (SETQ BYTE (RS232READBYTE] collect BYTE finally (RETURN $$VAL])

(RESET.PROSE
  [LAMBDA NIL                                                (* mmw: "18-Sep-84 15:27")

          (* * comment)


    (PROG (OUTPUTBYTES)
          [SETQ OUTPUTBYTES (APPEND OUTPUTBYTES (LIST 27 (CHCON1 (QUOTE %[))
						      0
						      (CHCON1 (QUOTE I]
          (for BYTE in OUTPUTBYTES do (RS232WRITEBYTE BYTE) finally (RS232FORCEOUTPUT])

(SAY
  [LAMBDA (INSTRING)                                         (* pkh: "21-Nov-84 10:28")
                                                             (* FOR BYTE IN OUTPUTBYTES DO 
							     (RS232WRITEBYTE BYTE) FINALLY 
							     (RS232FORCEOUTPUT))

          (* * comment)


    (PROG ((STRING (SUBSTRING INSTRING 1))
	   CHAR OUTPUTBYTES PHONEMEMODE (ESCAPECHAR (CHCON1 (QUOTE ←)))
	   (PORTCONTENT.BEFORE (READPORT)))
          (PROSE.RESET)
          (BLOCK 3000)
          (SETQ PORTCONTENT.BEFORE (READPORT))
          [while (SETQ CHAR (GNC STRING))
	     do [COND
		  ((EQ (CHCON1 CHAR)
		       ESCAPECHAR)
		    (SETQ PHONEMEMODE (NOT PHONEMEMODE))
		    (COND
		      (PHONEMEMODE (PHONEMEMODE (QUOTE ON)))
		      (T (PHONEMEMODE (QUOTE OFF]
		(RS232WRITEBYTE (CHCON1 (TRANSCRIPT CHAR]
          (PROSE.COMMENCE.OUTPUT)
          (RETURN (LIST PORTCONTENT.BEFORE (READPORT])
)
(DECLARE: DONTEVAL@LOAD DOEVAL@COMPILE DONTCOPY COMPILERVARS 

(ADDTOVAR NLAMA )

(ADDTOVAR NLAML )

(ADDTOVAR LAMA P.ESC.SEQ)
)
(PUTPROPS TALK COPYRIGHT (NONE))
(DECLARE: DONTCOPY
  (FILEMAP (NIL (515 5499 (CLEAR.PROSE 525 . 900) (P.ESC.SEQ 902 . 1477) (P.READBUFFER 1479 . 1997) (
P.RESET 1999 . 2308) (PHONEMEMODE 2310 . 2866) (PROSE.COMMENCE.OUTPUT 2868 . 3079) (PROSE.ESC.SEQ 3081
 . 3313) (PROSE.RESET 3315 . 3639) (PROSE.STOP 3641 . 3786) (READPORT 3788 . 4024) (RESET.PROSE 4026
 . 4454) (SAY 4456 . 5497)))))
STOP