# Unit synaser

Description | uses | Classes, Interfaces, Objects and Records | Functions and Procedures | Types | Constants | Variables

## Description

## uses

- Windows
- registry
- synafpc
- Classes
- SysUtils
- synautil

## Overview

### Classes, Interfaces, Objects and Records

Name | Description
--- | ---
Class `ESynaSerError` | Exception type for SynaSer errors
Class `TBlockSerial` | Main class implementing all communication routines

### Functions and Procedures

`function GetSerialPortNames: string;`

### Types

`THookSerialReason = (...);`
`THookSerialStatus = procedure(Sender: TObject; Reason: THookSerialReason; const Value: string) of object;`

### Constants

`CR = #$0d;`
`LF = #$0a;`
`CRLF = CR + LF;`
`cSerialChunk = 8192;`
`LockfileDirectory = '/var/lock';`
`PortIsClosed = -1;`
`ErrAlreadyOwned = 9991;`
`ErrAlreadyInUse = 9992;`
`ErrWrongParameter = 9993;`
`ErrPortNotOpen = 9994;`
`ErrNoDeviceAnswer = 9995;`
`ErrMaxBuffer = 9996;`
`ErrTimeout = 9997;`
`ErrNotRead = 9998;`
`ErrFrame = 9999;`
`ErrOverrun = 10000;`
`ErrRxOver = 10001;`
`ErrRxParity = 10002;`
`ErrTxFull = 10003;`
`dcb_Binary = $00000001;`
`dcb_ParityCheck = $00000002;`
`dcb_OutxCtsFlow = $00000004;`
`dcb_OutxDsrFlow = $00000008;`
`dcb_DtrControlMask = $00000030;`
`dcb_DtrControlDisable = $00000000;`
`dcb_DtrControlEnable = $00000010;`
`dcb_DtrControlHandshake = $00000020;`
`dcb_DsrSensivity = $00000040;`
`dcb_TXContinueOnXoff = $00000080;`
`dcb_OutX = $00000100;`
`dcb_InX = $00000200;`
`dcb_ErrorChar = $00000400;`
`dcb_NullStrip = $00000800;`
`dcb_RtsControlMask = $00003000;`
`dcb_RtsControlDisable = $00000000;`
`dcb_RtsControlEnable = $00001000;`
`dcb_RtsControlHandshake = $00002000;`
`dcb_RtsControlToggle = $00003000;`
`dcb_AbortOnError = $00004000;`
`dcb_Reserveds = $FFFF8000;`
`SB1 = 0;`
`SB1andHalf = 1;`
`SB2 = 2;`
`sOK = 0;`
`sErr = integer(-1);`

## Description

### Functions and Procedures

`function GetSerialPortNames: string;`

Returns list of existing computer serial ports. Working properly only in Windows!

### Types

`THookSerialReason = (...);`

Possible status event types for THookSerialStatus

- HR_SerialClose:
- HR_Connect:
- HR_CanRead:
- HR_CanWrite:
- HR_ReadCount:
- HR_WriteCount:
- HR_Wait:

`THookSerialStatus = procedure(Sender: TObject; Reason: THookSerialReason; const Value: string) of object;`

procedural prototype for status event hooking

### Constants

`CR = #$0d;`

`LF = #$0a;`

`CRLF = CR + LF;`

`cSerialChunk = 8192;`

`LockfileDirectory = '/var/lock';`

`PortIsClosed = -1;`

`ErrAlreadyOwned = 9991;`

`ErrAlreadyInUse = 9992;`

`ErrWrongParameter = 9993;`

`ErrPortNotOpen = 9994;`

`ErrNoDeviceAnswer = 9995;`

`ErrMaxBuffer = 9996;`

`ErrTimeout = 9997;`

`ErrNotRead = 9998;`

`ErrFrame = 9999;`

`ErrOverrun = 10000;`

`ErrRxOver = 10001;`

`ErrRxParity = 10002;`

`ErrTxFull = 10003;`

`dcb_Binary = $00000001;`

`dcb_ParityCheck = $00000002;`

`dcb_OutxCtsFlow = $00000004;`

`dcb_OutxDsrFlow = $00000008;`

`dcb_DtrControlMask = $00000030;`

`dcb_DtrControlDisable = $00000000;`

`dcb_DtrControlEnable = $00000010;`

`dcb_DtrControlHandshake = $00000020;`

`dcb_DsrSensivity = $00000040;`

`dcb_TXContinueOnXoff = $00000080;`

`dcb_OutX = $00000100;`

`dcb_InX = $00000200;`

`dcb_ErrorChar = $00000400;`

`dcb_NullStrip = $00000800;`

`dcb_RtsControlMask = $00003000;`

`dcb_RtsControlDisable = $00000000;`

`dcb_RtsControlEnable = $00001000;`

`dcb_RtsControlHandshake = $00002000;`

`dcb_RtsControlToggle = $00003000;`

`dcb_AbortOnError = $00004000;`

`dcb_Reserveds = $FFFF8000;`

`SB1 = 0;`

stopbit value for 1 stopbit

`SB1andHalf = 1;`

stopbit value for 1.5 stopbit

`SB2 = 2;`

stopbit value for 2 stopbits

`sOK = 0;`

`sErr = integer(-1);`

Generated by PasDoc 0.9.0 on 2012-04-23 21:38:52