Linux中的Mono中的SerialPort不响应DataReceived事件 [英] SerialPort in mono in linux not responding to DataReceived event

查看:292
本文介绍了Linux中的Mono中的SerialPort不响应DataReceived事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个使用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事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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