Search code examples
.netlinuxmonocross-platformserial-port

How Do I get the "friendly" name of serial port in Mono and keep it cross platform


I asked this question:
Serial Port (rs232) in Mono for multiple platforms

and this one is related:
How do I get the friendly name of a COM port in Windows?

But I want to be able to get the "friendly" name on Windows- and possibly also on linux /mac if there is such a thing.

Is there any cross platform way to do it, or am I out of luck?

Here is what I am doing in my current app - and it works great for native C++ win32.

http://www.naughter.com/enumser.html

In any case it does not look like a pretty solution for cross-platform distribution. Does anyone have any suggestions?

EDIT - since people are having trouble understanding what I am asking for: as an example - COM9 is not a friendly name. I want something that says "COM9 - USB connector" or something like that. This is possible with the link above in Win32. It is nasty and hacky, but many times end users have no idea what COM port they need to open in my program unless there is a useful name - more useful than "COMn."


Solution

  • AFAIK there is no "friendly" name for the COMM devices in linux. What I suggest you do is use the /dev/ttyS# as your device name in a linux environment and list them as COMM# in windows.

    The linux users will understand the terminology so there shouldn't be a worry there.