Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot list virtual serial ports on Windows 10 #187

Closed
golanguage opened this issue May 12, 2024 · 3 comments
Closed

Cannot list virtual serial ports on Windows 10 #187

golanguage opened this issue May 12, 2024 · 3 comments

Comments

@golanguage
Copy link

com0com mirror Null-modem emulator is a long history kernel-mode virtual serial port driver for Windows.

But these port cannot be detected by this lib;

serialport-rs on ξ‚  main is πŸ“¦ v4.3.1-alpha.0 via πŸ¦€ v1.78.0
❯ cargo run --example list_ports
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.56s
     Running `target\debug\examples\list_ports.exe`
No ports found.

I can find its port using WIN10 system serial tool:

❯ [System.IO.Ports.SerialPort]::getportnames()
CNCA0
CNCB0

Or anothere Rust serial port lib serial2.

serial2-rs on ξ‚  main is πŸ“¦ v0.2.24 via πŸ¦€ v1.78.0
❯ cargo run --example list-ports
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.09s
     Running `target\debug\examples\list-ports.exe`
Found 2 ports
CNCA0
CNCB0
sirhcel added a commit to sirhcel/serialport-rs that referenced this issue May 12, 2024
According to issue serialport#187 null-modem ports are appearing as CNCxy and
there have not been complaints about other devices showing up
unintendedly so far.
@sirhcel
Copy link
Contributor

sirhcel commented May 12, 2024

Thank you for bringing up this issue! You are mentioning serial2 which uses different enumeration strategy on Windows. There is #84 in our PR backlog since a while, which switches to the same strategy and it looks like this could resolve your issue as well.

I would like to integrate it with with a slight change as prototyped in https://github.com/sirhcel/serialport-rs/tree/missing-modem-ports (as of 0720d5a). Could you give this branch a spin? Will it make the null-modem ports you are looking for getting listed? And what about regular serial ports: do they show up as before and as you would expect them to?

@golanguage
Copy link
Author

seem it's a great job.
In fact, there is not a real serial port on the PC, all 4 ports are virtual.

serialport-rs on ξ‚  missing-modem-ports is πŸ“¦ v4.3.1-alpha.0 via πŸ¦€ v1.78.0
❯ cargo run --example list_ports
   Compiling serialport v4.3.1-alpha.0 (C:\proj\rust\serialport-rs)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 6.10s
     Running `target\debug\examples\list_ports.exe`
Found 4 ports:
  COM3
    Type: Unknown
  COM4
    Type: Unknown
  CNCA0
    Type: Unknown
  CNCB0
    Type: Unknown

Thank you for bringing up this issue! You are mentioning serial2 which uses different enumeration strategy on Windows. There is #84 in our PR backlog since a while, which switches to the same strategy and it looks like this could resolve your issue as well.

I would like to integrate it with with a slight change as prototyped in https://github.com/sirhcel/serialport-rs/tree/missing-modem-ports (as of 0720d5a). Could you give this branch a spin? Will it make the null-modem ports you are looking for getting listed? And what about regular serial ports: do they show up as before and as you would expect them to?

sirhcel added a commit that referenced this issue May 12, 2024
According to issue #187 null-modem ports are appearing as CNCxy and
there have not been complaints about other devices showing up
unintendedly so far.
@sirhcel
Copy link
Contributor

sirhcel commented May 12, 2024

Solved with integrating #84.

@sirhcel sirhcel closed this as completed May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants