-- File: DicentraRS232CAsync.mesa
-- Tim Diebert: 6-Aug-85  9:22:51

DIRECTORY
  Stream USING [Handle],
  TTY USING [Handle];

-- Follows DicentraRS232CAsync.mesa from the Cedar side.

DicentraRS232CAsync: DEFINITIONS = BEGIN
  
  CharLength: TYPE = MACHINE DEPENDENT {lengthIs5bits (0),
    lengthIs6bits (1), lengthIs7bits (2), lengthIs8bits (3), (255)};
  LineSpeed: TYPE =  MACHINE DEPENDENT {bps50 (0), bps75 (1),
    bps110 (2), bps150 (3), bps300 (4), bps600 (5), bps1200 (6),
    bps2400 (7), bps3600 (8), bps4800 (9), bps7200 (10), bps9600 (11),
    bps14400 (12), bps16800 (13), bps19200 (14), (255)};
  Parity: TYPE = MACHINE DEPENDENT {none (0), odd (1), even (2),(255)};
  StopBits: TYPE = MACHINE DEPENDENT {none (0), one (1),
    oneAndHalf (2), two (3), (255)};

  PortNumber: TYPE = [0 .. 16);
  CommParams: TYPE = RECORD
    [
    charLength: CharLength ← lengthIs7bits,
    speed: LineSpeed ← bps1200,
    parity: Parity ← even,
    stop: StopBits ← one
    ];
  
  defaultParams: CommParams =
    [charLength: lengthIs7bits, speed: bps1200, parity: even,
      stop: one];


  CreateRS232Instance: PUBLIC PROC [
    name: LONG STRING, backingStream: Stream.Handle, tty: TTY.Handle,
    parameters: CommParams ← defaultParams ] 
    RETURNS [ttyImpl, backing: Stream.Handle];
  
  KillIt: PUBLIC PROC [];
  
  END.....