Many thanks for your help and here is what I get as result.
TheResult picture is the output when selecting a device and the FormDesign picture is the form of my application.
the code is:
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
SynAser, LazSerial,
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
LazSerial1: TLazSerial;
Memo1: TMemo;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
function GetSerialPortNames: string;
var
sr : TSearchRec;
begin
Result := '';
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);
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
LazSerial1.ShowSetupDialog;
end;
end.
Maybe ou have any advice to me.
In advance many thanks