Unit synaser
Description
Serial port communication library
This unit contains a class that implements serial port communication for Windows or Linux. This class provides numerous methods with same name and functionality as methods of the Ararat Synapse TCP/IP library.
The following is a small example how establish a connection by modem (in this case with my USB modem):
ser:=TBlockSerial.Create;
try
ser.Connect('COM3');
ser.config(460800,8,'N',0,false,true);
ser.ATCommand('AT');
if (ser.LastError <> 0) or (not ser.ATResult) then
Exit;
ser.ATConnect('ATDT+420971200111');
if (ser.LastError <> 0) or (not ser.ATResult) then
Exit;
finally
ser.free;
end;
uses
- Windows
- registry
- synafpc
- Classes
- SysUtils
- synautil
Overview
Classes, Interfaces, Objects and Records
Functions and Procedures
Types
Constants
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
LockfileDirectory = '/var/lock'; |
ErrWrongParameter = 9993; |
ErrNoDeviceAnswer = 9995; |
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_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; |
stopbit value for 1 stopbit
stopbit value for 1.5 stopbit
stopbit value for 2 stopbits
Generated by PasDoc 0.9.0 on 2009-10-08 16:24:27