TTYPort.mesa
Copyright (C) Xerox Corporation 1982, 1985, 1986. All rights reserved.
Tim Diebert: November 16, 1985 7:42:24 pm PST
Bill Jackson (bj) July 31, 1986 0:30:29 am PDT
DIRECTORY
TTYPortEnvironment USING [CharacterLength, LineSpeed, Parity, StopBits];
TTYPort: CEDAR DEFINITIONS ~ {
Constants
nullChannelHandle: ChannelHandle ~ NIL;
Copied Types
CharacterLength: TYPE ~ TTYPortEnvironment.CharacterLength;
LineSpeed: TYPE ~ TTYPortEnvironment.LineSpeed;
Parity: TYPE ~ TTYPortEnvironment.Parity;
StopBits: TYPE ~ TTYPortEnvironment.StopBits;
Type Definitions
ChannelHandle: TYPE ~ REF ChannelStatus;
ChannelStatus: TYPE;
DeviceStatus: TYPE ~ RECORD [
aborted: BOOLEAN,
breakDetected: BOOLEAN, --latched
dataTerminalReady: BOOLEAN,
readyToGet: BOOLEAN,
readyToPut: BOOLEAN,
requestToSend: BOOLEAN
];
TransferStatus: TYPE ~ {
success,
parityError,
asynchFramingError,
dataLost,
breakDetected,
aborted,
abortedByDelete
};
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
];
Signals
ChannelAlreadyExists: ERROR;
ChannelQuiesced: ERROR;
InvalidLineNumber: ERROR;
NoTTYPortHardware: ERROR;
Procs
CharsAvailable: PROC [channel: ChannelHandle] RETURNS [number: CARDINAL];
Create: PROC [lineNumber: CARDINAL] RETURNS [ChannelHandle];
Delete: PROC [channel: ChannelHandle];
Get: PROC [channel: ChannelHandle] RETURNS [data: CHAR, status: TransferStatus];
GetStatus: PROC [channel: ChannelHandle] RETURNS [stat: DeviceStatus];
Put: PROC [channel: ChannelHandle, data: CHAR] RETURNS [status: TransferStatus];
Quiesce: PROC [channel: ChannelHandle];
SendBreak: PROC [channel: ChannelHandle];
SetParameter: PROC [channel: ChannelHandle, parameter: Parameter];
StatusWait: PROC [channel: ChannelHandle, stat: DeviceStatus] RETURNS [newstat: DeviceStatus];
}...