|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
SerialPort.GetPortNames() returns incorrect port names?SerialPort returns incorrect port names for virtual COM ports.
In my case it reports "COM5i" instead of "COM5" for Siemens MC35i terminal Hyperterminal shows "COM5". SerialPort.Open() doesn't work with these names - Incorrect port name error. Who knows how to get the correct names ? Hi,
GetPortNames returns the names that the device driver provides. If you want to filter that by some rules, you will have to do so yourself. HyperTerminal uses TAPI (different methods than are used by System.IO.Ports), so the results may not be exactly the same. So, why do you care? The name returned by GetPortNames may be used to open that port, right? Dick -- Richard Grier, MVP Hard & Software Author of Visual Basic Programmer's Guide to Serial Communications, Fourth Edition, ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March 2006. See www.hardandsoftware.net for details and contact information. Hi,
"Dick Grier" wrote: Unfortunately, no. This name causes System.IO.IOException with text "The > So, why do you care? The name returned by GetPortNames may be used to open > that port, right? port 'COM5i' does not exist.". Of course I can add filtering and fix broken COM port names, but probably there are any better solutions? Best regards Hi,
>> Of course I can add filtering and fix broken COM port names, but probablythere are any better solutions? << No, I'm fairly sure there is not. This is the first time that I've heard of this issue. I have dozens of different devices (many that use virtual serial ports), and none of these display this problem -- so it isn't common. The best thing to do would be to contact your manufacturer and to inquire about it there. You also can post it as an issue on http://msdn.microsoft.com/vstudio/support/default.aspx. Dick -- Richard Grier, MVP Hard & Software Author of Visual Basic Programmer's Guide to Serial Communications, Fourth Edition, ISBN 1-890422-28-2 (391 pages, includes CD-ROM). July 2004, Revised March 2006. See www.hardandsoftware.net for details and contact information. Hi,
"Dick Grier" wrote: Yes, I already discovered that. I found just one more incident, but with > No, I'm fairly sure there is not. This is the first time that I've heard of > this issue. I have dozens of different devices (many that use virtual > serial ports), and none of these display this problem -- so it isn't common. bluetooth device. Without any answer, unfortunately. > Yes. I'm currently trying to get response from Siemens. > The best thing to do would be to contact your manufacturer and to inquire > about it there. You also can post it as an issue on > http://msdn.microsoft.com/vstudio/support/default.aspx. Already posted. :) Thanks a lot. :) |
|||||||||||||||||||||||