<> <> <> <> <> DIRECTORY RS232CEnvironment USING [AutoRecognitionOutcome, CharLength, CompletionHandle, Correspondent, LineSpeed, LineType, Parity, PhysicalRecord, PhysicalRecordHandle, StopBits, SyncChar, SyncCount]; RS232C: DEFINITIONS = BEGIN <> Create: PROCEDURE [lineNumber: CARDINAL, lineType: LineType] RETURNS [ChannelHandle]; Get: PROCEDURE [channel: ChannelHandle, rec: PhysicalRecordHandle] RETURNS [CompletionHandle]; Put: PROCEDURE [channel: ChannelHandle, rec: PhysicalRecordHandle] RETURNS [CompletionHandle]; TransferWait: PROCEDURE [channel: ChannelHandle, event: CompletionHandle] RETURNS [byteCount: CARDINAL, status: TransferStatus]; Delete: PROCEDURE [channel: ChannelHandle]; Suspend: PROCEDURE [channel: ChannelHandle, class: OperationClass]; Restart: PROCEDURE [channel: ChannelHandle, class: OperationClass]; GetStatus: PROCEDURE [channel: ChannelHandle] RETURNS [stat: DeviceStatus]; StatusWait: PROCEDURE [channel: ChannelHandle, stat: DeviceStatus] RETURNS [newstat: DeviceStatus]; <> AutoRecognitionWait: PROCEDURE [channel: ChannelHandle] RETURNS [outcome: AutoRecognitionOutcome]; GetLineCount: PROCEDURE RETURNS [numberOfLines: CARDINAL]; TransmitNow: PROCEDURE [channel: ChannelHandle, event: CompletionHandle] RETURNS [byteCount: CARDINAL, status: TransferStatus]; SendBreak: PROCEDURE [channel: ChannelHandle]; SetParameter: PROCEDURE [channel: ChannelHandle, parameter: Parameter]; SetLineType: PROCEDURE [channel: ChannelHandle, lineType: LineType]; <> ChannelAlreadyExists: ERROR; ChannelSuspended: ERROR; InvalidLineNumber: ERROR; InvalidParameter: ERROR; NoRS232CHardware: ERROR; SendBreakIllegal: ERROR; UnimplementedFeature: ERROR; <> LineType: TYPE = RS232CEnvironment.LineType; ChannelHandle: TYPE [2]; AutoRecognitionOutcome: TYPE = RS232CEnvironment.AutoRecognitionOutcome; CompletionHandle: TYPE = RS232CEnvironment.CompletionHandle; OperationClass: TYPE = {input, output, other, all}; PhysicalRecordHandle: TYPE = RS232CEnvironment.PhysicalRecordHandle; PhysicalRecord: TYPE = RS232CEnvironment.PhysicalRecord; TransferStatus: TYPE = { success, dataLost -- (caused by input buffer overrun --, deviceError, frameTimeout, checksumError, parityError, asynchFramingError -- (i.e. stop bit(s) missing) --, invalidChar, invalidFrame, aborted, disaster}; DeviceStatus: TYPE = RECORD [ statusAborted: BOOLEAN, dataLost: BOOLEAN, <> breakDetected: BOOLEAN, --latched clearToSend, dataSetReady, carrierDetect: BOOLEAN, <> ringHeard: BOOLEAN, --latched version of EIA RS-232-C Ring Indicator ringIndicator: BOOLEAN, deviceError: BOOLEAN]; Parameter: TYPE = RECORD [ SELECT type: ParameterType FROM charLength => [charLength: CharLength], correspondent => [correspondent: Correspondent], dataTerminalReady => [dataTerminalReady: BOOLEAN], frameTimeout => [frameTimeout: CARDINAL], latchBitClear => [latchBitClearMask: LatchBitClearMask], lineSpeed => [lineSpeed: LineSpeed], parity => [parity: Parity], requestToSend => [requestToSend: BOOLEAN], stopBits => [stopBits: StopBits], syncChar => [syncChar: SyncChar], syncCount => [syncCount: SyncCount], ENDCASE]; ParameterType: TYPE = {charLength, correspondent, dataTerminalReady, frameTimeout, latchBitClear, lineSpeed, parity, requestToSend, stopBits, syncChar, syncCount}; CharLength: TYPE = RS232CEnvironment.CharLength; Correspondent: TYPE = RS232CEnvironment.Correspondent; LatchBitClearMask: TYPE = DeviceStatus; LineSpeed: TYPE = RS232CEnvironment.LineSpeed; Parity: TYPE = RS232CEnvironment.Parity; StopBits: TYPE = RS232CEnvironment.StopBits; SyncCount: TYPE = RS232CEnvironment.SyncCount; SyncChar: TYPE = RS232CEnvironment.SyncChar; END. <<>> <<>> <> <> <> <> <> <> <<>>