TTYPort.mesa
Copyright (C) Xerox Corporation 1982, 1986. All rights reserved.
Tim Diebert: December 8, 1986 3:08:07 pm PST
DIRECTORY
TTYEnvironment USING [CharacterLength, LineSpeed, Parity, StopBits];
TTYPort: CEDAR DEFINITIONS = BEGIN
Procedures, alphabetically
CharsAvailable: PROCEDURE [channel: ChannelHandle] RETURNS [number: CARDINAL];
Create: PROCEDURE [lineNumber: CARDINAL] RETURNS [ChannelHandle];
Delete: PROCEDURE [channel: ChannelHandle];
Get: PROCEDURE [channel: ChannelHandle] RETURNS [data: CHARACTER, status: TransferStatus];
GetStatus: PROCEDURE [channel: ChannelHandle] RETURNS [stat: DeviceStatus];
Put: PROCEDURE [channel: ChannelHandle, data: CHARACTER] RETURNS [status: TransferStatus];
Quiesce: PROCEDURE [channel: ChannelHandle];
SendBreak: PROCEDURE [channel: ChannelHandle];
SetParameter: PROCEDURE [channel: ChannelHandle, parameter: Parameter];
StatusWait: PROCEDURE [channel: ChannelHandle, stat: DeviceStatus]
RETURNS [newstat: DeviceStatus];
ChannelAlreadyExists, ChannelQuiesced, InvalidLineNumber, NoTTYPortHardware: ERROR;
nullChannelHandle: ChannelHandle = NIL;
ChannelHandle: TYPE ~ REF ChannelStatus;
ChannelStatus: TYPE;
TransferStatus: TYPE = {success, parityError, asynchFramingError, dataLost, breakDetected, aborted, abortedByDelete};
DeviceStatus:
TYPE =
RECORD [
aborted: BOOLEAN,
breakDetected: BOOLEAN, --latched
dataTerminalReady: BOOLEAN,
readyToGet: BOOLEAN,
readyToPut: BOOLEAN,
requestToSend: BOOLEAN];
Parameter:
TYPE =
RECORD [
SELECT parameter: * FROM
breakDetectedClear => [breakDetectedClear: BOOLEAN],
characterLength => [characterLength: CharacterLength],
clearToSend => [clearToSend: BOOLEAN],
dataSetReady => [dataSetReady: BOOLEAN],
lineSpeed => [lineSpeed: LineSpeed],
parity => [parity: Parity],
stopBits => [stopBits: StopBits],
ENDCASE];
CharacterLength: TYPE = TTYEnvironment.CharacterLength;
LineSpeed: TYPE = TTYEnvironment.LineSpeed;
Parity: TYPE = TTYEnvironment.Parity;
StopBits: TYPE = TTYEnvironment.StopBits;