Changeset 346 for Network/synapse


Ignore:
Timestamp:
Apr 20, 2012, 10:19:53 AM (13 years ago)
Author:
chronos
Message:
  • Fixed: Opening nonstandard serial port devices under Linux (e.g. /dev/ttySAC0).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Network/synapse/synaser.pas

    r300 r346  
    250250
    251251  {:@abstract(Main class implementing all communication routines)}
    252   TBlockSerial = class(TObject)
     252  TBlockSerial = class
    253253  protected
    254254    FOnStatus: THookSerialStatus;
     
    813813begin
    814814  FComNr := PortIsClosed;
    815   if pos('COM', uppercase(Value)) = 1 then
    816     FComNr := StrToIntdef(copy(Value, 4, Length(Value) - 3), PortIsClosed + 1) - 1;
    817   if pos('/DEV/TTYS', uppercase(Value)) = 1 then
    818     FComNr := StrToIntdef(copy(Value, 10, Length(Value) - 9), PortIsClosed - 1);
     815  if Pos('COM', UpperCase(Value)) = 1 then
     816    FComNr := StrToIntdef(Copy(Value, 4, Length(Value) - 3), PortIsClosed + 1) - 1;
     817  if Pos('/DEV/TTYS', UpperCase(Value)) = 1 then begin
     818    FComNr := StrToIntdef(Copy(Value, 10, Length(Value) - 9), PortIsClosed);
     819  end;
    819820end;
    820821
     
    19001901  SerialCheck(ioctl(integer(FHandle), TCFLSH, TCIOFLUSH));
    19011902  {$ELSE}
    1902   SerialCheck(fpioctl(integer(FHandle), TCFLSH, TCIOFLUSH));
     1903  SerialCheck(fpioctl(integer(FHandle), TCFLSH, Pointer(TCIOFLUSH)));
    19031904  {$ENDIF}
    19041905  FBuffer := '';
Note: See TracChangeset for help on using the changeset viewer.