How do I get the friendly name of a COM port in Windows?

后端 未结 8 1065
再見小時候
再見小時候 2020-12-05 08:09

I have a GSM modem connected via USB. The modem creates 2 serial ports. The first is automatically attached to the modem, the second shows in Device Manager as \"HUAWEI Mo

8条回答
  •  孤街浪徒
    2020-12-05 08:31

    I built a library for serial port control. It can search the friendly name in registry. Here is the link.

    https://github.com/kcwongjoe/serial_port

    std::vector comPorts = SerialPort::getSerialPortList();
    std::cout << comPorts[0].friendlyName << std::endl;
    

提交回复
热议问题