Access the serial port in a platform-independant way [closed]

ε祈祈猫儿з 提交于 2019-12-03 09:02:17

Use Boost Asio (using C++)!

(http://www.boost.org/doc/libs/1_51_0/doc/html/boost_asio.html)

It's guaranteed to be platform independent: http://www.boost.org/doc/libs/1_51_0/doc/html/boost_asio/using.html

Though what makes it much better than any other libraries is that it supports asynchronous communications. I think that feature makes it very useful in your device-control software. And don't forget that it is part of Boost whose libraries are very reliable.

I've used it on my sms messaging program (using AT commands sent through serial/COM ports).

Hope this solves your problem as it has solved mine.

You can have a look on the Java Communication Api

For C / C++, you can use /dev/ttySx device under linux, MacOS and Cygwin (for Windows). If the USB-RS232 converter is based on a FTDI chip, you can have a look on the libFTDI. Finally, you can eventually check RS-232 for Linux and Windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!