UsingtheInterlisp-DRS232FacilityFile:Library>RS232.teditCreated:Jan10,1983,byJonLWhiteRevised:2/21/83,8/18/83,3/12/84,and10/31/84RS232communicationspermituseofsynchronousaswellasasynchronousprotocols,throughasmallpieceofhardwareforserial/parallelconversioncalledaUSARToraUART;theformerisnecessarywhensynchronousprotocolsareused.Currently,Lisp'sonlyinterfaceistotheasynchronousprotocol,whichbasicallymeansthatan8-bit"character"maybesent,atanytime,throughtheUSART/UART,andsimilarlyan8-bit"character"maybereceivedatanytime.TherearethreeportsavailableunderInterlisp-DforRS232communications,twoofwhichareonthe1108,andoneonthe1100.Forthe1108,oneRS232portisstandard(dubbedtheTTYPort)andanotherisoptional(theE30option,dubbedtheRS232Cport);forthe1100,thereisanoptionalcircuitboardpluggedintotheparallelport.TheRS232CportisaUSART,terminatinginastandard25-pinconnectoratthebackofthe1108,andanextensioncableisprovidedwhichterminatesina25-pinmaleconnectorwiththestandardRS232signals;theTTYPortisaUART,whichterminatesina25-pinfemaleconnectoratthebackofthe1108andforwhichaspecialadaptorcablemustbebuilt(seebelow);thecircuitboardforthe1100terminatesina25-pinmaleconnectoronashortcable.TherearesomeknowndeficiencieswithrespecttotheRS232protocolsintheTTYPort;seethefootnoteonRS232MODEMHANGUPbelow.Portselectiononthe1108iscontrolledbytheglobalvariableRS232DLionTTYP,whichmayberesetatinitializationtime;currently,thedefaultvalueisT,meaning"usetheTTYPort",butlikelywiththenextrelease,itwillbeNILmeaning"usetheRS232Cport".Ascharactersarriveinattheinterfaceport,theyarestoredinLisp'smemoryinaringbuffer;andtheoutputfunctionswillbuffertheirdatainaringbufferuntilitisfull,oruntilexplicitrequestismadetoforceitout.Theoutputringbufferisone512-bytepage,andtheinputringbufferistwopages.[[Footnote:Twoglobalvariablescontroltheinitialsizesettingsforthesebuffers,soitispossibletotailorthesizetoaspecificapplication.]]However,whenusingtheRS232Cport,theinputbufferwillbesetto4,l8,or16pagesdependingonthelinespeed,soastoprovideatleastseveralsecondsworthofbufferingatfullspeed.[[Footnote:The1100hasnomicrocodesupportforbufferingthecharactersastheycomein,andsimilarlythe1108hasnolow-levelsupportfortheTTYPort;thustherearesomelimitationsusingthesetwoports--primarilythattheuserhastocalloneofthefunctionswhichwillupdatetheinputringbufferatintervalsfrequentenoughtoinsuregettingallthecharacters.]]The"host"name{RS232}isusableasadevice-orientedinterfacetotheRS232ports.Afterthedevicehasbeeninitialized,(GETSTREAM'{RS232})willreturnthisbi-directionalstream(whichisalsocachedintheglobalvariable\RS232SRTREAM).However,thestreaminterfaceisnotrecommendedexceptwhenusingtheRS232Cport[[Footnote:Inmostcases,thegeneralstream-orientedfunctionswillnotworkforthe1100orthe1108'sTTYPortbecausethetimetakenbygeneralI/Ooperationsisunpredictableandoftenquitelarge.However,atveryslowspeeds,thentheRS232BACKGROUNDprocessisturnedonforinput,theremaybesomeusabilityhere.]]InitializationBeforeusingtheRS232facility,itisnecessarytoinstallcertainparametersinUARTorUSARTbehindthechannel,andthefunctionRS232INITisprovidedforthatpurpose.(RS232INITBaudRateBitsPerSerialCharParityNoOfStopBitsModemControlPort)Theargumentscorrespondtothedesiredbaudrate(150,300,600,...9600aresupportedonallchannels,and19200issupportedontheRS232Cchannel),thenumberofbitsperserialcharacter(i.e.,7or8),whetherornottousethe8thbitasaparitybit(andifso,thenthisargumentmustbeeitherODDorEVEN),thenumberof"stop"bits(exceptinunusualcases,1thedefaultvalue,isusedhere),andthesettingofanymodemcontrollines(seedescriptionofRS232MODEMCONTROLbelow).ThePortargumentcurrentlyonlyselectsbetweentheTTYPortandthe(optional)RS232Cportonthe1108;ifanon-NILvalueissupplied,itmustbeeitherthelitatomTTYPortorRS232C;ifNIL,thentheglobalvariableRS232DLionTTYPisconsulted,withnon-NILmeaningtousetheTTYPortandNILmeaningtousetheRS232Cport.ThedefaultvaluesforallargumentsareBaudRate1200BitsPerSerialChar8ParityNILNoOfStopBits1ModemControlNILPortNIL{i.e.,consultsRS232DLionTTYP}CAUTION:thevalueofRS232INITasaglobalvariableisusedbythesedriverfunctionstocontainacopyofthisargumentlist;donotresetitatanytime.OnemayuseOPENSTREAMasanalternativetocallingRS232INITdirectly,butthenonemustthenbundleupalltheparametersintothePARAMETERSargument,wheretheformalparameter q?` p q?` g_p bh bh aT L P TX\l #|$((0(.aT `@ `@ _,%X_, ^@HL"&^ ]&(.] [ [ Z Z Y Y X !$j&n .~035 > FFX WT #|.< 5:T;?ACGIIW Vd "),80@0 8P=@`GIIV Ux  d"$(,0@2D6L >\A CGIIUx Td   #|*4,80@ 8P;=CEGGTd SP TSP R< R< Q($j(r 0327:ADFJJQ( P X`t#|$(&)-0@4H79?EGGP O #|&,+0@27\@`AFlFlM L `l &(+.037:T\ GJtJtH GtTX #|),8.46BdGGGGt F` P  %'*4.4?CFlHpHpF` EL   &,(.<2D4H6L;?AHpHpEL D8 Xd "&,(0*0@36L;?D8 C$ C$ B R !#*v.~149>;B?DFHHB @ P`#|&+/246L9>\BdDhFlJtJt@ ?  lp "&(,8,/4H7\A GG? > \dt!x"$$)*4 2D49@`EHpHp> =Tlt%')+138P;>\@`AGG= < "$$)-0@4H8\A CEGII< ; l#|%').04:T?CEE; : l #|$(&*4,.5;=DhGG: 9p X\t&,(,8.07=?BdHpHp9p 8\ PXd t#|'*4.<0@6:T=@`CEHpHp8\ 7H Xt$(&*.<24;AFlHpHp7H 64h "#|64 5 5 4 N !%')3:<?JCRHHH4 2 `l $( +2D5:T= GG2 1\`pt"$&,78P>\A EE1 0` p"$%),804H \AFlII0 /T $(&*4,/247\?EGJtJt. - P #|(*/14H8=?AEE- , , +l +l *X *X )D )D (0 (0 '" ,' & & $V^%')/17:< CFI^I^$ # dp "(/17:T=C# " L $) 2D ;?" ! \ t$(0+/26L78:T;>\A GII!  \ "$',825:T\ EII, Th!x$(&,8.<038PWAITFORFINISH).(RS232BACKGROUNDON?PERIOD.ms)willinitiateabackgroundlow-levelprocess(yes,aPROCESS)whichwillservicetheUARTatleastonceeveryPERIOD.msmilliseconds(defaultvalue:16ms),and/orforceouttheoutputbufferasoftenaspossible.Thefirstargumentmustbeamong{OFF,INPUT,OUTPUT,BOTH,ON};OFFterminatesthisbackgroundactivity;OUTPUTcausesonlytheoutputbuffertobeforcedout;INPUTcausesonlytheperiodicservicetotheinputbuffer;andeitherONorBOTHcausesbothactivities.TheinputserviceisreallyonlyapplicabletotheportsotherthanRS232C,whichhasanindependentmechanismtoinsurethatcharactersaretransportedinatimelyfashionfromtheUARTtotheringbuffer.Forthe1100,andforthe1108'sTTYPort,aperiodof16millisecondsfortheinputservicetimeshouldgivetheappearanceofasynchronousbuffering,withoutdroppinganycharacters,whenusedatspeedsoflessthanabout600baud.Anon-NILvalueforPERIOD.mswillbecoercedtobeatleast16ms,andnotmorethan1000ms.InputFunctions(RS232PEEKBYTE)returnsthenextcharactersittingintheinputringbuffer,ifany;thehardwareportischeckedtoseeifanyinputcharactersarewaiting,andifsotheyaremovedintotheringbufferfirst.FortheportsotherthanRS232C,callingthisfunctionisagoodwaytoinsurethatcharactersaremoved,inatimelyfashion,fromtheUSART/UARTtotheinputringbuffer.Aswithany"peek"function,thereturnedbyteisnotremovedfromthestream.(RS232READBYTEWAIT?timerUnits)isthebasicinputfunction,whichwillreturneitherNILorafixpbetween0and255inclusive.Bothargumentsareoptional.Ifnocharacterisavailable,RS232READBYTEwillreturnNIL;butifWAIT?isafixp,thenitwillwaituptothatmanytimeunitsbeforereturning(possiblygettinganincomingcharacterinthemeantime);ifWAIT?isanyothernon-NILvalue,theitwillwait(possiblyforever)untilsomebytecomesintobereturned.Thesecondargumentdeterminesthelengthofa"timeunit";defaultismilliseconds,butalternativesareSECONDS,MILLISECONDS,andTICKS(whichistheinternalmachineclockunit,andvariesinvaluebetweenthe1100and1108--seesection14.6oftheInterlispReferenceManual"TimersandDurationFunctions").AswithRS232PEEKBYTE,anycalltothisfunctionwillupdatetheinputringbufferbeforedoinganythingelse.(RS232READWORDWAIT?timerUnits)Iftwobytescanbereadintheallotedtime,theyarecomposedintoa"word";thefirstbytecomprisesthehigh-order8bitsofa16-bitword,andthesecondbytecomprisesthelow-order8bits.(RS232READLINEWAIT?timerUnitsOLDSTRBUFFER)readsasequenceofcharactersuntilanEnd-of-Linecharacterisreceived;allthecharactersexcepttheEOLarereturnedasastring.ThefirstarugmentsareinterpretedexactlyforRS232READBYTE;thatis,iftheexpectedEOLisnotseen"intime",thenNILisreturned.However,ifthethirdargumentissupplied,itmustbeastring,anditsstoragewillbere-usedtoreturnthecharactersaccumulatedsofar,evenifthereisatimeout.Oneothercaveat:upto8charactertimesaredalliedafterreceivingtheEOL,toseeifitisfollowedbyaline-feed,andifso,theline-feedisflushed.(RS232READSTRING#CHARS.LIMIT?STOPCODE?NOBLOCKSFLGWAIT?timerUnitsOLDSTRBUFFER)isthebasic"blockmode"inputfunction;theargumentsarealloptional,andthelastthreeJt ( g_p hs hs bh PTd$($'- 48P:T=@`BdGIJtbh aT "f%%aT `@. "&37`@ _, X\p $&,8-2D8;>\CEHpHp_, ^dt#|%(0,2 \CEGIIO M   "%*4*-38P ?CEIIM LT`t!x$*,/158P=?BdGIIL KT`d K J J I Ld " *4,8.59\?EGGI HT`h"$%'),/28>\A EH Gt Gt F` Ld !x"$'*-025:T=BdDhJtJtF` EL dp "$(0.<0@2D6:T=@`CEHpHpEL D8   &)/25:T>\AHpHpD8 C$ \ p"'.</49\DhIIB @ P\  %0@@ ? ? > Lh $(*4+ 29?CDhJtJt> = Xh"&,*40 9?DhII= <`!x#|')0@037=A CGG< ; t " *4- 4;@`EHpHp; : X "$"&+.17=?AEE: 9pT"&, .<.15;=AEE9p 8\ X\ !x&*-/ 7>\@`EHpHp8\ 7H X t$(),/247 ?@`CEII7H 64 T"$& /2D48>\AFlII64 5    &,+14H \CEE  \ !x' 037\A GG |T\d $*4,0@26L8P;@`CEHpHp| hd!x$(*4 2358 CEIIh T T`p $(',804;?T @ @ , L `h !x"$$(&*-/247=A DhGG, \ $(*- 46L9;=AEHpHp  Xl$&,*4    L `h *4.</57 ?CEE  !x$(& .<258P;A CDhIJtJt  d "$'*4 4H7:T\Dhd P P < L & .2 :T C < ( dlt&,(/2D4;>\A DhHpHp (` q?` 3functionjustasinRS232READLINE.Characterswillbeaccumulateduntiloneofthreeconditionsoccur:1.Thetotalnumberofcharacterstakeninbythiscallisequalto#CHARS.LIMIT?(NILmeansnolimit);or2.AcharacterisreceivedwithcharactercodeequaltoSTOPCODE?(NILmeansnolimitingcharcter);or3.AnintervaloftimegreaterthanthatspecifiedbyWAIT?haspassedwithnobytesavailableattheport.IfNOBLOCKSFLGisnon-null,thenRS232READSTRINGwillconsumealltheCPUcycleswithoutofferingtoyieldtootherprocesses(includingtheMOUSEprocess);thismodeisimportanttovery-time-criticalapplications,butmostparticularlywhenusingtheportsotherthanRS232C.OutputFunctions(RS232WRITEBYTEBYTEFORCEOUT?IGNOREXOFF?)willsendoutone8-bitbyte;ifFORCEOUT?isNIL,thebytewillsimplybestoredintheoutputringbuffer,andwillbenotactuallybe"sent"untilsomeconditionarisestoforceoutthebuffer.Theoutputringbufferwillbeforcedoutifthesecondargumentisnon-NIL,orwheneverthereisanexplicitcalltothefunctionRS232FORCEOUTPUT,orfromtimetotimewhenRS232BACKGROUNDhasspecifiedbackgroundoutputfromthebuffer(seedocumentationabove).EspeciallywiththeRS232Cport,itincursahighoverheadcosttodoaforceoutputoneverycharactersent.(RS232WRITECHARSSTRINGFORCEOUTPUT?)sendsoutallthecharactersinthefirstargument,whichmaybeeitheralitatomorstring.SecondargumentisinterpretedthesameaswithRS232WRITEBYTE.ModemInterfaceFunctions(RS232XON\XOFF?ON?)controlstheprocessingofthein-bandXONandXOFFcharacterssentbythecorrespondent;whenON?isnon-NIL,suchprocessingwillbeenabled;whenON?isNIL,itwillbedisabled.WhentheRS232portisinitialized,thisfeatureisdisabled.[[Footnote:Upuntilthefallof1984,thisactionwasdeterminedbythevalueoftheglobalvariableRS232XON\XOFF?;inordertoensureasmoothtransition,therewilbeaperiodoftimeduringwhichthefunctionalinterfacewillmerelysetthisglobalvariable.Thiscross-overperiodwillextendatleastuntilthenextreleaseofInterlisp-d.Butultimately,itwillhavetocarryoutactionsthatarenotconsistentwithaLispvariablesetting.]]Thismeansthatthelow-leveldriverfunctionswilllookfor^Sontheincomingside,andwill"gag"theoutputtransmitteruntilasubsequent^Qhasbeenreceived.Wheninthe"gag"'dstate,thevalueoftheglobalvariableRS232XOFF?willbeT;whennot"gag"'d,itwillbeNIL.Itshouldhardlybenecessarytomentionthatitwillcauseunduetroubletoturnthisfeatureonwhenthecorrespondinghostdoesn'talsoobeytheXON-XOFFprotocols.[[Footnote:SincetheRS232Cportcontainsadditionalbuffering"outboard"ofthe1108,LispwillprobablynotseeanincomingXOFFcharacterinthetimerequiredbysomecorrespondents;thisproblemwillbefixedinafuturereleaseofsoftware,butitisthe"outboard"I/OprocessorthatisatfaulthereratherthanLisp]]Thisprotocolis,ofcourse,temporarilyturnedoffbytheRS232FTPfunctions,whichtransmitandreceiverandombytes.(RS232SENDBREAKEXTRALONG?)sendstheout-of-bandBREAKsignal,foraperiodof0.25seconds;iftheoptionalargumentEXTRALONG?isnon-NIL,thentheperiodisextendedto3.5seconds.(RS232MODEMCONTROLSIGNALSONLST)isalambda-nospreadfunctionwhichsetsthemodemcontrollinestobe"on",forthesignalsnamedinthelistSIGNALSONLST;itreturnstheformersettingofthelines.IfSIGNALSONLSTisnotsupplied(whichisnotthesameassupplyingNIL),thenthecontrollinesremainunchanged.TheentriesinSIGNALSONLSTarelitatomnamesforstandardmodemcontrollines;currentlyusablesignalnamesareDTRandRTS.(RS232MODIFYMODEMCONTROLSIGNALSONLSTSIGNALSOFFLST)Changesonlythosemodemcontrollinesspecifiedintheunionofthetwoarguments;thoseinSIGNALSONLSTaresettobeon,andthoseinSIGNALSOFFLSTaresetoff.Returnstheformerstatejustas(RS232MODEMCONTROL)does.(RS232MODEMSTATUSPSPEC)Returnsnon-nulliffthereadingofthemodemstatuslinesisconsistentwiththebooleanformspecifiedbySPEC;modemstatussignalscurrentlysupportedareCTS,DSR,RI,andRLSD.SPECmaybeanyAND/OR/NOTcombinationoverthesignalnames.Example:(RS232MODEMSTATUSP'(ANDCTS(NOTRLSD))).(RS232MODEMHANGUP)takeswhateverstepsappropriatetocausethemodemto"hangup";generally,thismeansturningtheDTRsignaldownforabout3seconds,oruntiltheDSRsignalhasgonedown[[Footnote:Thereisabuginthelow-levelcodeforthe1108's"outboard"I/OprocessorsuchthattheTTYPortcan'tactuallyturnofftheDTRsignal;aconsequenceofthisisthatRS232MODEMHANGUPwillnotworkontheTTYPort.]]ErrorConditionReportingHp ( g_pIhsJjhs bh\`d !x"$ ),. 6;=?CCbh aT X aT `@Z^ %)+-1.46:< FFJ J `@ _, `d_, ^F!$j+".~24;B>BDJJ^ ] X\] [^#'*v1.327:9>ACHH[ Z`hZ Y   *.<36L8;@`EEY X " *4,07;>\@`GIIX W "&, .2D6L8=A DhIW V V Ux Ux Td Td SP")8SP R< R< Q( L h (,8/2D48==?FlHpHpQ( P P\lp"$$(&+.4H6:T\BdDhIJtJtK J P\ $&*15J I I H Ll $(+.<0 8P:T=A GGH Gt d %&,*02 ;=A CFlFlGt F`F` EL EL D8 D8 C$ C$ B!(/DB @ @ ? ? > L ht"$ )+.<36L8 = $(0 /24;>\A CFlHpHp= < PT  $(&, .2D79@`A II< ;  t$(& .<0@268;@`FlFl; :!x"' /36L8P9>\@`CHpHp: 9p  "$&),18P89= DhII9p 8\ P"$') 2D236L >\@`CGII8\ 7H  h &,)*.<4H ;\@`DhFlGG/ . t!x#|&, -0@6:T\BdEJtJt. - P  &, .<257:T@` GG- ,  %, +l +l *X L "$$ ,06L8:T?A DhJtK K *X )D  "$$(*4-0@46=?AG)D (0 (0 ' L !x#|$/0@6L:T=@`DhII' &  l $&), 6L8P=@`EJtJt& $ \  #|).<0@258;AEII$ #   "$"%*, 58P=ADhJtJt# " \#|(0,8.14H7" ! ! L $ .4H7;?EII `hl (0,8.< 69\@`CEII | `$(&+/24BdFl| h h T L!x'*4,2D4H6;?CEET @ Xd &(,05;AHpHp@ , \  "$' . 6:T=AFlGG,  "f%+    L"$&, .<0@4H6;=A DhDh  X #|(0+.<2D39;?BdEII  \ lt!x"%'*404H69>\ EHpHp dt#|),/2D4:T; CEII  T $(&,( 0@ x x d d P P <!(/D < ( (   q?`S4Thehardwarewilldetecttheusualerrorconditions(droppedcharacters,parityerrorswhensoinitialized,andframingerrors)inadditiontodetectingaBREAKbeingsent.Additionally,certainlow-levelerrorsmayoccurineitherthehardwareorsoftwarewhichcanonlybeclassifiedasdeviceerrors.Therearethreeglobalvariablesprovidingafunctionalinterfacetothehandlingoftheseerrors:RS232BREAKFN,RS232LOSTCHARFN,andRS232DEVICEERRORFN.WhenaBREAKhasbeendetected,thesoftwarewillsettheglobalvariableRS232BREAKSEEN?tonon-NIL;itwillalsocheckthevalueofRS232BREAKFN,andifnon-NIL,willapplyittoNIL.Similarly,ifthereisanyerrorconditionwhichcausesacharactertobedropped,thelow-leveldriverswillapplythevalueofRS232LOSTCHARFN,ifnon-NIL,toalitatomdescribingthereasonforthelossage.Currentlythe"reasons"are:DroppedCharacter,ParityError,FramingError,RingBufferFull,LineBufferFull,andMultipleErrors(whichisacatch-allforanycombinationoftheforegoing"reasons").ThedefaultvalueforRS232LOSTCHARFNis\RS232DING,whichwill"flash"thedisplayscreenacoupleoftimes,andputthevalueof\RS232.DROPPEDCHARACTER.CODEintotheringbuffer[initiallythisissetto(CHARCODE#^G)].Finally,whensomeinscrutable"deviceerror"occurs,thevalueofRS232DEVICEERRORFN,ifnon-NIL,willbeappliedtoalitatomreason.Currentlythe"reasons"are:TransmitterWedgedandRS232CDisaster.TheformeristypicalofaTTYPortusewithouttheproperadaptorcable;thelatterseemstoindicateabuginthelow-levelI/Oprocessorsoftware.ThedefaultvalueforRS232DEVICEERRORFNis\RS232.DEVICEERROR,whichwill"flash"thedisplayscreenacoupleoftimes,andprintamessageinthePROMPTWINDOW.RS232CHATFacilityThefunctionRS232CHAT,withfouroptionalarguments,initiatesafull-duplextransmissionthroughttheRS232port.(RS232CHATTypeScriptStreamBINHOOKLocalEchoStreamXON\XOFF?)Thefirstargument,TypeScriptStream,iscoercedintoastreamforprintingthereceivedcharacters(defaultistousethewindowinthevalueof\RS232CHATWINDOW,whichifnull,willinteractivelyasktheusertolayoutaregionforsuchwindow);ifBINHOOKisnon-NIL,iatisauser-programmableinterfaceforfilteringthecharacterswhicharrivefromtheremotecorrespondent;NB:itmustbetheoutputofthefunctionMAKEBINHOOK[[Footnote:thisfacilityisn'tfullyreadyyet--it'sprimaryapplicationwillbetoprovideaflexiblemeansforemulationofthevarioussemi-smartterminalsliketheHeath-19etc.];ifLocalEchoStreamisnon-NIL,itspecifiesthatlocalechoingofthetyped-incharactersistobedone,withTmeaningtousethesamestreamasthefirstargument,andanyothervaluebeingcoercedintoastream;XON\XOFF?controlswhetherornottousetheXON\XOFFprotocol.Whilein"chat"mode,characterinterruptsareshutoff,thekeyboardisratherplainlyinterpreted,andcharacterstypedinonitaresenttothecorrespondent.Ordinarily,ahostwillsendaCR/LFfor"newline",butsomesendonlyone;amenuselectionfromthechatwindowletsyoupickoneortheotherifthisisthecase(especiallyusefulwithUNIXsystems).Similarly,youcanspecifythattheRETURNkey(or,EOLkey)sendeitherjustCRorbothCR/LF.Iflocalechoingisbeingperformed,anditthelocalechostreamisthesameasthemainRS232CHATwindow,thenthelocally-generatedcharacterswillbeenclosedinsquare-brackets,asameansofdistinguishinglocalechofromremoteoutput.Caveatapplicabletothenon-RS232Cportsonly:Sinceoutputtothethedisplaytakesanon-trivialamountoftime(e.g.,justgoingthroughthecharacterprintoutroutines,and"painting"acharacterontothescreenbit-maprequiresoveramillisecond,andscrollingamodest-sizedwindowmaytakewellover30milliseconds)itisquestionablewhetherbaudratesabove2400willbeacceptableforRS232CHAT,andtheremayevenbeocasionalproblemsabove1200baud.At"slower"speeds,thatis,atlessthanabout600baud,theuseofRS232BACKGROUNDmayalleviatetheseproblems.However,RS232CHATwillpayattentiontotheDSPSCROLLsettingofthechatwindow,andwilldo"roll"moderatherthan"wrap"modeprovidedthatitcandosowithoutdroppingcharacters["roll"describesthe"scrollup"actionwhentypeoutreachesthebottomofthewindow].IftheXON/XOFFprotocolisbeingused,orifthebackgroundprocessmentionedaboveisinoperation,thenlikelytherewillbenoproblemisusing"roll"mode.Escapefrom"duplex"modeismadebytypingthethecharacterwhichisfoundinthevalueof\RS232ESCAPE.CHARCODE,currentlyinitializedto(CHARACTER#B)[thishappenstobemiddle-blank].Typing"?"justaftertheescapecharacterwillgiveasmall"helpmessage;thecommandstobeusedinthismodeareallone-letter:B-sendaBREAK(0.25seconds)E-changetheescapecharacterF-deactivatetheXON\XOFFprotocolH-callthefunction(HELP),withinterruptsre-activatedL-callthefunction(RS232.PROMPT&LOGIN)O-settheXON\XOFFprotocolactiveQ-forquitandexit,presumablybacktoLISPXS-setthespeedoftheRS232port;?willdisplaychoices.-'Return'keysendstoremotehost-'Return'keysendstoremotehost  g_p hs hs bh L T`p $((0 /5 =BdGJtJtbh aT d"$$(*4,824H8P\@`FlIIZ Y ` Y X X W NRZ^!%+/45<>@FI^I^W V hp $(&,139;=Bd IIV Ux Xp$(&-0= EEUx Td \(+ 5:T\>\R< Q(p #|&+ 26L8P;=CHpIIQ( P P OR #)-3259;I^I^O M `d %*+2D4;??M L #|$(&+-246L;>\CFlFlL Kl $(&,,8-0@2D4;>\EEK JXhp ,.? > d#|%*.</4H6=?EE> = Xdhl %'*4.<0@\@`BdEJtK K . - `dl "%'*4.<16L8P;>\@`CFlFl- , h(0 /24;=HpJtJt, +l LTX lt"&,*0@+l *X *X )D L X p $(,057:T=BdFlGG)D (0  $((0-0@6=CFlFl(0 ' Xht$()/24H =?FlGG' & dp $(&, /13 \@`@`# "d"$()/6L9\BdDhFlII | Xp!x#|% ,0@48\@`EGG| h h T T @ L X #|%*4,/6L:T\?  T`   L P\d"$  L P\ !x  L P  $  L P #| * 3  L P( x L PX $x d L PXdl "&,(0,8d P L PX $&,).4P < L Thp "'* < ( L Thp#|%*4- ( q?` 5^B-runa"break"orHELPloopR-callRAID7-truncateincomingcharactersto7bits(thisisnecessarywhenyouhaveopenedan8-bitconnectionignoringtheparitybit;youreallyonlywanttoseethelower7bitsinterpretedasacharactertobeprintedonthewindow).8-undothe"7-bit"modeabove(justincaseyouactuallywantedtoseetheeightbit--typicallytheprintoutwillbejustthesameasasthe7-bitprintout,butpreceededbya"#"whentheeighthbitisoninacharacter.)Additionalcontrolmaybeexercisedwiththepop-upmenuobtainedbypressingthemiddlemousebuttonwiththecursorintheRS232CHATwindowwhileRS232CHATisactive;itscommandsareessentiallyself-documenting,andareasuper-setoftheabove-mentionedcommandsavailablefromthekeyboard.Inparticular,it'spossibletoalterwhatRS232CHATthinksisthe"NewLine"character;Interlisp-D'sdefaultistochooseCR,butforconnectionstosomesystems,LFisamuchbetterchoice.Twoothercommandspermit"toggling"(thatis,switchingthestatefromonechoicetoanalternate,andvice-versa):~LocalEchoand~RollMode.ThelatterwillchangetheDSPSCROLLof\RS232CHATWINDOW;theformerwill"toggle"theuseofthelocalechostreamprovidedinthecalltoRS232CHAT(orwilluse\RS232CHATWINDOWifnostreamwasprovided).Anumberofinternalglobalvariablescontrolcertaincharacteristics;inadditionto\RS232ESCAPE.CHARCODEmentionedabove,thereare:\RS232PERMITTED.INTERRUPTS--alistofitemssuchasreturnedbyINTERRUPTCHAR(orsuchaswouldbeinputtoRESET.INTERRUPT),whichwillbe"active"duringRS232CHAT;initiallythislistisnull.\RS232CHAT.IgnoreCharcodes--alistofcharactercodesthatwillbeignoredbytheinputsideofRS232CHAT;initiallythislistcontainsonlythesinglecode(CHARCODENULL).\RS232CHAT.EOLsequence--AstringofcharacterstobesentoutwhenevertheRETURNkeyistypedonthekeyboard;initiallythisjustcontainstheonecharacterCR,andischangeablebyamenucommand.\RS232CHAT.NEWLINECHAR--NormallysettoLF,whichwillcauseRS232CHATtoworkrightforsystemswhichsendbothCR/LFfornewlineaswellasforthosethatsendonlyLF(e.g.,UNIX).However,somehostssendonlyCR,andthustogetRS232CHATtoadvancetoanewline,CRmustberecognizedasthe"newline"character.Thisoptionischangeablebyamenucommand.Notethatthissectionisn'ttalkingabouttheEOLcharacter.\RS232CHAT.BellSequence--SincethestandardInterlisp-Dactionforprintinga"bell"toadisplaystreamtakestoolong(muchlongerthantheinter-charactertimeat1200baud),thenwhenanon-RS232Cportisinuse(unlesstheXON\XOFFprotocolisenabled),thisstringofcharacterswillbesubstitutedforthe(CHARCODEBELL).Initially,itisjust"^".Thefollowingtwofunctionsaremostusefulwhentryingto"chat"toahostthroughanRS232portrunningataspeedhigherthanInterlisp-Dcansupportfordisplaystreamactivities:(RS232LOGINHOSTUserNamePASSWORDHostSYSTEMTYPETypeScriptStreamPROMPTFORWORDstreamURGENCY.OPTION)Ofthe7arguments,mostareoptional.HOSTisanameforthemachinewithwhichtheRS232portiscorresponding;UserNameisthedesiredusername/login.idonthatmachine;PASSWORDisthepasswordneededthere;HostSYSTEMTYPEisthehost'soperatingsystemtype(currently,onlyTOPS-20,TENEX,VMS,UNIX,WAITS,ITS,andTOPS10areknowsystemtypes;TENEXisthedefault);theremainingthreeargumentsareconcernedwheretoechotheactivitycausedbythisfunction,andaremainlyofinteresttoothersystem-levelfunctions.TheglobalvariableRS232OSTYPESisparalleltoNETWORKOSTYPES,butthenamesarenotinanywaycoordinatedwithanamedatabase,suchasoccurswithethernetprotocols;infact,NETWORKOSTYPESwillalsobeconsultedbyRS232LOGIN,soitwouldnotbewisetouseanameforanRS232correspondentthatisinconflictwithNETWORKOSTYPES.IfeitherUserNameorPASSWORDisNIL,theywillbeobtainedviaPROMPTFORWORDfromthekeyboard(thisissothatyoudon'thavetohavepasswordsincodefiles);thereisalsoaninternalcacheoftheinformationabouthost/username/password,justasiskeptforloginsovertheEthernet.WhentheHost'ssystemtypeisknown,thenadatabaseofloginprotocolsisconsultedtofigureouthowtosend(automaticallyandblindly)thenecessarycharacterstoeffectalogin.Atconvenientmoments,theoutputfromthehost,whichisaccumulatedintheRS232linebuffer,willbeoutputfortheuser'sperusal(thefifthargumentisastreamforthisprintout:NILdefaultstotheprimaryoutput,NONEgagsthistype-out;window,filesets.allareacceptablehere).Aprimaryreasonforthisfunction'sexistence,besidesthecacheingofsuchinformationaslogin.idandpassword,istopermitloggininatspeedswhichcannotsupportRS232CHAT(seedocumentationabove);also,itisconvenienttobeabletoselect"Login"fromtheRS232CHATmenuandhavetheloginsequencesentautomatically.(RS232.PROMPT&LOGINTypeScriptStream)promptstheuser(viaPROMPTFORWORD)totypeinthenecessaryinformation,inthePROMPTWINDOW,tocallanduseRS232LOGIN;theargumentishandedtoRS232LOGINasitsfifthargument(the"Type-outstream"argument).- ( g_pIhsJjhs bh L  T\!xbh aT L P T aT `@ L P "$$(%(,.58;`@ _, L P Tdhp $*-2D58P=_, ^ L P T p!x"&, .<0@18P:T@FHHJ It$((0+I H H Gt Lpt $(&,*4-/57Gt F` L P dpt#|%)+7;??F` EL L P   "$(,8/15EL D8 Lpt $(&,,04H79?D8 C$ L P  #|*4-06:T=C$ B L P  !xB @ L"$ ,8.<0@36L L P d #|%&*40@> = L"%'*4.<15\< ; L P l %*4*04H8P;??; : L P \l"$$()+,/358;;: 9p L P `d (0(,802 :TAGZI^I^. - X"&, .<06L8>\CC- , , +l +l *X L \" ,8P8*X )D&F1)D (0  dp$($(0*4+.14H9=A CGG(0 ' PT ht!x$()57;A GII' & d &,(0*/6L;>\ FlII& $ $(&+.<16L;?A CJtJt$ # \d '(0,8.<14H:T?A DhDh# "\ "$( 1 89\EGG d"$ ,8.47>\ EGG `d $',8/2D6L:TMUMBLE")(RS232PUTFILE'{DSK}RUN.DCOM'BINARY'MODEM"MODEMRBRUN.DCOM")BothendsoftheMODEMprotocolhave"synchronizing"features,soatypicalscenarioofusagewouldbetouseRS232CHATtologintothehost,andthensimplyputtheMODEMprograminitswaitstate,bytypingwhateverargumentsitneeds,andfinallyexitingfromRS232CHATandcallingRS232GETFILE(orRS232PUTFILE)directly,withoutthefourthargument.Onereasonforthefourth-argumentcapabilityissothatonemayuseRS232FTPatspeedsgreaterthanwouldbeavailableforRS232CHAT--logincouldbeachievedthroughuseofthefunctionRS232.PROMPT&LOGIN,andfiletransferthroughtheuseofRS232GETFILEorRS232PUTFILE,andnoneedarisesatallforaterminalprotocol.TheglobalvariableRS232FTPTRACEFLG,ifnon-null,causesatraceofactivitytobeprintedoutonthefile/streamspecifiedbytheglobalvariableRS232TRACEFILE;itthevalueisPEEK,thenonlya"+"willbeprintedforsuccessfultransitofpackets,and"-"forunsuccessfulones;anyothernon-nullvaluecausesamoreverboseoutput.SeveralimplementationsoftheMODEMprotocolforothermachinesareavailable:onefortheIBM/PCisavailableonfloppydiskthroughXeroxArtificialIntelligenceSystems;othersareavailableforVAX/VMSandVAX/UNIXusers.8 ( g_p hs hs bh bh aT aT `@ `@ _, L P TX\` dlt%_, ^ ^ ]RZ ')/*159>?CREVI^I^] [ t!x$*-4H6L8 @`FlFl[ Zh &,*4/05;>\AFlJtJtZ Y X`  (0*.<2D5;\ FlIIM L  dl#|(0*,2@`CIIL K T dl #|&*,/4H6L =@`DhGIIK J X &,+02479\AEIIF` EL "$%*,817>\EL D8 D8 C$d  "$&*C$ B B @ L ` t#|$(()*4@ ? L P T`d#|? > > = = < L ` &,&+,8,< ; L P T`d !x; : : 9p 9p 8\FV^$j'29>;B<AHJ J 8\ 7H  t!x%'*4.<04H8;>\BdGII7H 64 l!x(0*4.16\??BdGII5 4  d  "&,(+.<4H6L;@`CGII4 2\ $(&,,814H6L8??2 1dp#|(+.<0@ 8; DhGII1 0 Ph '0 / / .NZ(r*v1.57:;B=FCREVGZGZ. -T %'*4.4?@`BdEII- , \ %(0 /46=?BdEE, +l hp#|',8-06L;+l *X *X )D )D (0J !#'-04:=F DEVHJJ(0 ' X\ $()- 4 =CHpHp' & \ l$)& $ $ # # " " ! ! h q?` ~SNAIL8$5GsZ Afj/igM#{ERIS}LIBRARY>RS232.TTY;5JONL.PA19-Nov-84 17:37:53