> Von: Lukas Gebauer 

> I am little confused. Synaser code is designed for any device name! 
> ttyS is used just for translate windows "COMx" names into linux 
> names. So, call Connect with any linux devicename does not work? If 
> not, then it is a bug.

i found where my problem come from. 
first the good news, you are right, it works.

The problem came from the handling of the /dev/ttyS devices.

GetSerialPortNames gives you a list of the devices without the /dev/.
If you try it with a Windows COM port in linux, there is no problem becaus the 
get GomPortNr gives you the Portnumber and a /dev/ttyS + Nr is created. 
If i'm working with GetSerialPortNames, i have to add the /dev/ folder to the 
device.
So i did the following Modification

procedure TBlockSerial.Connect(comport: string);
 ..
begin
  {$IFNDEF MSWINDOWS}
  if (pos('TTY', uppercase(comport)) = 1) then
    comport := '/dev/' + comport;
  {$ENDIF}

For the ttyS devices there is no problem because of  GetComNr
procedure TBlockSerial.GetComNr(Value: string);
begin
  FComNr := PortIsClosed;
  {$IFNDEF MSWINDOWS}
  if pos('COM', uppercase(Value)) = 1 then
    FComNr := StrToIntdef(copy(Value, 4, Length(Value) - 3), PortIsClosed + 1) 
- 1;
  {$ELSE}
  if pos('/DEV/TTYS', uppercase(Value)) = 1 then
    FComNr := StrToIntdef(copy(Value, 10, Length(Value) - 9), PortIsClosed - 1);
  if pos('/DEV/TTYAM', uppercase(Value)) = 1 then
    FComNr := StrToIntdef(copy(Value, 11, Length(Value) - 10), PortIsClosed - 
1);  
  if pos('/DEV/TTYUSB', uppercase(Value)) = 1 then
    FComNr := StrToIntdef(copy(Value, 12, Length(Value) - 11), PortIsClosed - 
1);
  {$ENDIF}
end;

In GetSerialPortNames i added

  if FindFirst('/dev/ttyUSB*', $FFFFFFFF, sr) = 0 then begin
    repeat
      if (sr.Attr and $FFFFFFFF) = Sr.Attr then begin
        if Result <> '' then Result := Result + ',';
        Result := Result + sr.Name;
      end;
    until FindNext(sr) <> 0;
  end;
  FindClose(sr);
  if FindFirst('/dev/ttyAM*', $FFFFFFFF, sr) = 0 then begin
    repeat
      if (sr.Attr and $FFFFFFFF) = Sr.Attr then begin
        if Result <> '' then Result := Result + ',';
        Result := Result + sr.Name;
      end;
    until FindNext(sr) <> 0;
  end;
  FindClose(sr);

> What crashed, where it crashed? How it crashed?

There where three problems.
1. the missing /dev
2. access rights for the port ... :-( debian ...
3. i stopped a debug session and the port - lock file was not deleted and it 
blocks further accessing.

So you see it was my fault - PEBKAC

> Use version from the SVN. Release 40 is very old, and I rather 
> updating SVN, where you can find most actual sources.

Ok, ill do.

And thanks a lot for the help 
and this great peasce of software (synalist), 
it helped me a lot.

Best wishes




---
Alle Postfächer an einem Ort. Jetzt wechseln und E-Mail-Adresse mitnehmen! 
http://email.freenet.de/basic/Informationen


------------------------------------------------------------------------------
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to