Welcome, Guest
Username: Password: Remember me
CodeTyphon Linux OS Development, discussions and problems
  • Page:
  • 1

TOPIC:

synapsevs how i can get only usb serial ports anable show a lot ports 2 weeks 6 days ago #19605

  • Fernando Sandoval
  • Fernando Sandoval's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 72
  • Thank you received: 0
Hello i how can get only the ports enabled i got big list but i get connect to any support on lsubs show port usb002 is my modem but on synapse don't show up like that how get only the port used or enables

Please Log in or Create an account to join the conversation.

synapsevs how i can get only usb serial ports anable show a lot ports 1 week 6 days ago #19606

  • Vlad Wilhelm
  • Vlad Wilhelm's Avatar
  • Offline
  • Junior Member
  • Junior Member
  • Posts: 35
  • Thank you received: 2
procedure TmainFrm.FormCreate(Sender: TObject);
var
 sr: TSearchRec;
 r: integer;
begin
 ComboBox1.Items.Clear;
 r:= FindFirst('/sys/class/tty/*', faDirectory, sr);
 while r = 0 do begin
  if (sr.Name[1] <> '.') and DirectoryExists('/sys/class/tty/' + sr.Name + '/device/driver')
  then ComboBox1.Items.Add('/dev/' + sr.Name);
  r:= FindNext(sr);
    end;
 FindClose(sr);
end;

The presence of the "device/driver" subdirectory distinguishes a real hardware port.

Please Log in or Create an account to join the conversation.

  • Page:
  • 1