euantorano / serial.nim

A Nim library for accessing serial ports.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux implementation won't list the Bluetooth related serial ports

LucaWolf opened this issue · comments

At least on my Fedora machine, the serial ports created by the Bluetooth driver are not listed.

I have enhanced my local copy (list_serialports_linux.nim) with:

let fullDevicePath = "/sys/class/tty" / filename / "device" # serial have this path
let fullDeviceRFPath = "/sys/class/tty" / filename / "dev" # bluetooth
...
if subsystem != "platform":
      result = true 
elif fileExists(fullDeviceRFPath):
  result = true
else:
  result = false

If these seems right to you please include the above changes in mainstream.

Thanks,
Luca

Some more information about listing Linux serial devices: