Linux中的Mono中的SerialPort不响应DataReceived事件

编程入门 行业动态 更新时间:2024-10-26 18:29:02
本文介绍了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事件

本文发布于:2023-08-07 18:14:17,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1320809.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:事件   Mono   Linux   DataReceived   SerialPort

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!