• How to open a COM port for a GetCommProperties call?

    From R.Wieser@21:1/5 to All on Tue Oct 3 14:22:17 2023
    Hello all,

    I'm in a bit of a catch-22 : I want to know which baudrates a(n USB to
    serial) COM port supports *before* opening it, but the GetCommProperties function needs an open COM port to be able to fetch that information. :-(

    ... Or is there a way to "open" a COM port for inspection only, not letting
    an attached serial device know the COM port is ready for business.

    I /imagine/ there is (opening the "control channel" to the involved device driver), but in all my time I've never encountered anything describing how
    to do it. So, I'm stuck.

    Help please ?


    -- second question:

    GetCommProperties returns a COMMPROP structure* for which the MSDN page
    defines speeds upto 128k bps. But when I use CommConfigDialog it shows me a
    few specific speeds (230400, 460800, 921600) above it. Where do those come from ?

    * https://learn.microsoft.com/en-us/windows/win32/api/winbase/ns-winbase-commprop

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From R.Wieser@21:1/5 to All on Wed Oct 4 13:10:30 2023
    GetCommProperties returns a COMMPROP structure* for which the MSDN
    page defines speeds upto 128k bps. But when I use CommConfigDialog it
    shows me a few specific speeds (230400, 460800, 921600) above it.
    Where do those come from ?

    Odd: although ComConfigDialog shows those above three extra baudrates, when
    I actually open the port (using CreateFile) and call GetCommProperties I'm
    not seeing any bitflags that could indicate those baudrates, and I am
    allowed to also set a 134.5 baudrate.

    IOW, what the build-in ComConfigDialog shows does not seem to be what the
    port can actually do. :-(

    Regards,
    Rudy Wieser

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)