Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.programmer > #315

Re: Serial terminal

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!weretis.net!feeder5.news.weretis.net!feeder.news-service.com!216.196.110.144.MISMATCH!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.brightview.co.uk!news.brightview.co.uk.POSTED!not-for-mail
NNTP-Posting-Date Thu, 19 May 2011 18:43:44 -0500
From "Ste (news)" <steve@revi11.plus.com>
Subject Re: Serial terminal
Newsgroups comp.sys.acorn.programmer
Date Fri, 20 May 2011 00:43:40 +0100
Message-ID <51d6104786steve@revi11.plus.com> (permalink)
References <9Oh*KpqDt@news.chiark.greenend.org.uk> <4dd4222b$0$310$14726298@news.sunsite.dk> <-Oh*qMqDt@news.chiark.greenend.org.uk> <9Oh*G0qDt@news.chiark.greenend.org.uk> <4dd5a0ea$0$14694$ba4acef3@reader.news.orange.fr>
User-Agent Pluto/3.04d (RISC-OS/5.11) NewsHound/v1.50-32
Organization None
Lines 67
X-Usenet-Provider http://www.giganews.com
X-Trace sv3-YFlh6AB2Bn33C02Qmc0bxPvkvQThGvWsYkxQGQS4Lpnp/ehCP0Jr8x7n25J0CUrFH/zCH4k+l/HnIkO!nT2pNYVWvRA5dAGUtSRWZTl9DVbrknagtzI9HhdZM6LswJddrX4qM3qNLytcEahb1ZDLHMkLkkjl!IQ==
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2856
Xref x330-a1.tempe.blueboxinc.net comp.sys.acorn.programmer:315

Show key headers only | View raw


In article <4dd5a0ea$0$14694$ba4acef3@reader.news.orange.fr>,
   Rick Murray <heyrickmail-usenet@yahoo.co.uk> wrote:
> On 18/05/2011 23:05, Theo Markettos wrote:
>
> > Does OS_SerialOp have sensible defaults on later OSs?  It must be a long
> > while since anyone wired an 'Acorn' cable.
>
> When I wrote my little terminal prog, I loaded and used the serial 
> blockdrivers. Not much help to you, I know, but I got fed up of SerialOp 
> doing different things to what I expected...

Here's my utterly untested serial terminal program. Good luck with this...

  in%  = 0
  out% = 0
  ON ERROR PROCerror
  
  *FX 7 8
  *FX 8 8
  SYS "OS_Byte", 129, 0, 255 TO , hw%
  IF hw% < &AA THEN
    REM Pre-Iyonix uses Serial module
    in%  = OPENIN"devices#baud19200;sleep:$.Serial"
    out% = OPENOUT"devices#baud19200;sleep:$.Serial"
  ELSE
    REM Iyonix and later uses DualSerial module (assume serial1 port)
    in%  = OPENIN"devices#baud19200;sleep:$.Serial1"
    out% = OPENOUT"devices#baud19200;sleep:$.Serial1"
  ENDIF
  
  DIM buf% 256
  REPEAT
    INPUT"Send: " $(buf%)
    send%      = LEN $(buf%)
    buf%?send% = 13
    SYS "OS_GBPB", 2, out%, buf%, send% + 1
    read% = EXT#in%
    IF read% THEN
      SYS "OS_GBPB", 4, in%, buf%, read%
      buf%?read% = 13
      PRINT"Recv '" $(buf%) "'"
    ENDIF
  UNTIL send% = 0
  
  IF in%  THEN CLOSE#in%
  IF out% THEN CLOSE#out%
  QUIT
  :
  DEF PROCerror
    ON ERROR OFF
    PRINT REPORT$ " at line " STR$(ERL)
    IF in%  THEN CLOSE#in%
    IF out% THEN CLOSE#out%
    QUIT
  ENDPROC
  :

Probably best to run this in a task window. Yes, there's potential for
buffer overflows, etc.

Ta,

Steve

-- 
Steve Revill @ Home
Note: All opinions expressed herein are my own.

Back to comp.sys.acorn.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Serial terminal Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-05-18 19:27 +0100
  Re: Serial terminal Alex Macfarlane Smith <nospam@archifishal.co.uk> - 2011-05-18 20:46 +0100
    Re: Serial terminal Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-05-18 21:04 +0100
      Re: Serial terminal Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-05-18 22:05 +0100
        Re: Serial terminal Rick Murray <heyrickmail-usenet@yahoo.co.uk> - 2011-05-20 00:59 +0200
          Re: Serial terminal "Ste (news)" <steve@revi11.plus.com> - 2011-05-20 00:43 +0100
          Re: Serial terminal James Peacock <j.peacock.news@googlemail.com> - 2011-05-20 10:35 +0100
            Re: Serial terminal Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-05-20 17:44 +0100
  Re: Serial terminal jgharston <jgh@arcade.demon.co.uk> - 2011-05-20 01:25 -0700
    Re: Serial terminal Theo Markettos <theom+news@chiark.greenend.org.uk> - 2011-05-20 16:23 +0100

csiph-web