问题
I am looking for a c++ library that can connect to and communicate with serial port devices. I need one that can be used on windows and linux. I have found "serialib" already but this has no feature for enumerating the available ports.
So I either need a cross platform "port enumerator" library or a whole new cross platform serial port library.
Does anyone know of a good one?
Thanks, Dan.
回答1:
http://wjwwood.io/serial/
https://github.com/wjwwood/serial
This is a cross-platform serial port library, which is MIT licensed and has no external dependencies for runtime.
回答2:
The QextSerialPort project is a cross-platform serial port library that includes port enumeration. Here is their example of doing a simple enumeration of all serial ports.
来源:https://stackoverflow.com/questions/11467054/is-there-a-cross-platform-c-serial-port-library-that-can-enumerate-ports