We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 9 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(6)
您可能会认为用于串行端口的跨平台 C 库已经存在了 20 年,但截至 2013 年仍然没有,所以我创建了 libserialport。
它在 Windows、Mac OS X、Linux(包括 Android)、BSD 上进行了测试,并且也可能在其他 Unix 系统上构建。它支持:
Sigrok 项目正在积极使用最初的 0.1.0 版本来支持串行硬件并已打包在多个 Linux 发行版中。 git 版本还包括新的 API 调用,用于获取有关 USB 串行适配器(VID/PID 等)的信息。
You would think that a cross-platform C library for serial ports is something that would have existed for 20 years already, but as of 2013 there still wasn't one, so I created libserialport.
It is tested on Windows, Mac OS X, Linux (including Android), BSD and will probably build on other Unix systems also. It supports:
The initial 0.1.0 release is in active use by the Sigrok project for supporting serial hardware and is packaged in several Linux distributions already. The git version also includes new API calls for getting information about USB serial adapters (VID/PID etc).
这是一个无耻的插件,但我有一个 MIT 许可的 RS-232 通信库,它可以移植到 Windows、Linux 和 OS X:
http://wjwwood.io/serial/
This is a shameless plug, but I have a MIT licensed library for RS-232 communication which is portable to Windows and Linux and OS X here:
http://wjwwood.io/serial/
我知道你说的是 C 而不是 C++,但也许你可以使用 增强 Asio 的串行端口 并将其编译到库中以与您的 C 应用程序链接。它声称兼容 POSIX,而 OS X 就是 POSIX。
I realize that you said C and not C++, but perhaps you could use Boost Asio's serial ports and compile that into a library to be linked with your C application. It claims to be POSIX compatible, and OS X is POSIX.
我在 MIT 许可证下发布了我的: https://github.com/Marzac/rs232
它是在C 语言,适用于 Windows、Mac 和 Linux。
I released mine under the MIT license: https://github.com/Marzac/rs232
It is programmed in C and works well for Windows, Mac and Linux.
OS X 支持标准 POSIX 串行 API,来自
和
。查找函数tcsetattr()
、cfsetspeed()
等。OS X supports the standard POSIX serial API, from
<termios.h>
and<unistd.h>
. Look up the functionstcsetattr()
,cfsetspeed()
and so on.获取一些额外的 OS X 特定 Objective-C 代码,例如 AMSerialPort、goSerial、serialconnect、PolKit 等,并实现 C 源文件的条件编译。
http://osx.hyperjeff.net/Apps/apps?f=serial
Get some additional OS X-specific Objective-C code along the lines of AMSerialPort, goSerial, serialconnect, PolKit, ... and implement a conditional compilation of your C source file.
http://osx.hyperjeff.net/Apps/apps?f=serial