Project

General

Profile

Feature #26

list available com ports

Added by Hamish about 15 years ago. Updated about 15 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
2008-04-20
Due date:
% Done:

0%

Estimated time:

Description

it should be possible to request a list of available serial ports, including some current status for each one

History

#1

Updated by Hamish about 15 years ago

  • Target version set to 0.3
#3

Updated by Hamish about 15 years ago

I have done some research and this appears to be more difficult than it should be.

  • PORT_INFO_2 doesn't provide much information (http://msdn2.microsoft.com/en-us/library/ms535509(VS.85).aspx)
    nrports=12
    Port       Monitor         Desc            Type Reserved
    Microsoft Document Imaging Writer Port: Local Monitor   Local Port         1        0
    COM1:      Local Monitor   Local Port         1        0
    COM2:      Local Monitor   Local Port         1        0
    COM3:      Local Monitor   Local Port         1        0
    COM4:      Local Monitor   Local Port         1        0
    FILE:      Local Monitor   Local Port         1        0
    LPT1:      Local Monitor   Local Port         1        0
    LPT2:      Local Monitor   Local Port         1        0
    LPT3:      Local Monitor   Local Port         1        0
    COM5:      Local Monitor   Local Port         1        0
    COM6:      Local Monitor   Local Port         1        0
    IcePortER: Ice Monitor E   Black Ice Port     1        0
    
  • SetupDiEnumDeviceInterfaces (http://forum.sysinternals.com/forum_posts.asp?TID=4544 and http://msdn2.microsoft.com/en-us/library/ms793116.aspx) doesnt find enough interfaces:
    DevicePath=\?\acpi#pnp0501!#1#{4d36e978-e325-11ce-bfc1-08002be10318}
    DevicePath=\?\acpi#pnp0501!#2#{4d36e978-e325-11ce-bfc1-08002be10318}
    
  • There is an entire library for doing this (http://www.naughter.com/enumser.html) that checks seven different methods for com ports, but its licence may be incompatible with GPL

Also available in: Atom PDF