我正在编写一个使用Mono中SerialPort类公开的串行端口的应用程序.到目前为止,我所写的内容在Windows中都可以完美运行,但是在Linux中,从未输入DataReceived事件处理程序,因此我无法从设备接收任何数据.我已经声明了事件处理程序,如下所示:
I am writing an app that uses the serial port exposed by the SerialPort class in mono. What I have written so far works perfect in windows, however in linux the DataReceived event handler is never entered, so I cannot receive any data form my device. I have declared the event handler as follows:
comPort.DataReceived += new SerialDataReceivedEventHandler(comPort_DataReceived);基本上,我正在探索良好的跨平台选项,这是一个破坏交易的因素.关于如何解决此问题或正在发生什么的任何建议?
Basically I am exploring good cross-platform options and this is a deal-breaker. Any advise on how to fix this or what is going on?
编辑- 我还应该指出,我已经在Linux和其他应用程序上测试了串行端口和设备,并且一切似乎都可以正常工作.
Edit- I should also point out that I have tested the serial port and device on linux with other applications and all appears to be working.
推荐答案mono不支持串行端口事件.
mono does not support Event for serialport.
它显示在 mono的网站
更多推荐
Linux中的Mono中的SerialPort不响应DataReceived事件
发布评论