How to get serial port device VID/PID/Name using System.IO.Ports.SerialPort on MacOs?

Viewed 17

I am working on a cross platform app for Windows and Mac using .Net6 and Avalonia. My app needs to communicate with a device using usb serial. To do that I am using the System.IO.Ports.SerialPort class.

On Windows, to get the VID/PID of the connected device (and assess which com port is my device) I use a registry search method. This works well and I can identify easily which com port represents my device.

However, when running the app on MacOS I obviously can't use the registry method. I can only get a list of ports using SerialPort.GetPortNames() method which lists quite a lot of ports, including my device listed as "/dev/cu.usbmodem14101". I know that by comparing the list before and after connecting my device.

Is there a way to get any identifying feature of my device (VID, PID, Name etc) to identify it automatically?

0 Answers
Related