C:跨平台的RS232串行库? [英] C: cross-platform RS232 serial library?

查看:214
本文介绍了C:跨平台的RS232串行库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要寻找一个开源的跨平台库,用于在C串行口,沿真棒pyserial库线(不幸的是我不得不用C此应用程序)

I am looking for an open source cross-platform library for working with the serial port in C, something along the lines of the awesome pyserial library (Unfortunately I have to use C for this application)

我只发现这一个: http://www.teuniz.net/RS-232/ 并似乎并未有提及OSX的兼容性。

I have only found this one: http://www.teuniz.net/RS-232/ and that doesn't seem to have mention OSX compatibility.

任何建议/意见将大大AP preciated。

Any recommendations/comments would be greatly appreciated.

感谢。

推荐答案

您会认为,串行端口一个跨平台的C库是一些本来存在已经20年,但由于2013年还有没有之一,所以我创建 libserialport

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.

这是在Windows,Mac OS X,Linux操作系统(包括Android),BSD测试,将可能建立在其它Unix系统也。它支持:

It is tested on Windows, Mac OS X, Linux (including Android), BSD and will probably build on other Unix systems also. It supports:


  • 端口枚举(获得串口的系统列表)

  • 打开,关闭和查询端口

  • 设置端口参数(波特率,奇偶校验等)

  • 端口信号操作(调制解调器控制线,休息等)

  • 阅读,写作和冲洗数据

  • 等待事件

  • 获取的错误信息

最初的0.1.0版本是由积极利用Sigrok 项目支持的串行硬件和封装在一些Linux发行版了。 Git版本还包括用于获取有关USB串口适配器的信息新的API调用(VID / PID等)。

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).

这篇关于C:跨平台的RS232串行库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆