linux中单声道中的SerialPort不响应DataReceived事件

编程入门 行业动态 更新时间:2024-10-26 22:21:29
本文介绍了linux中单声道中的SerialPort不响应DataReceived事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在编写一个应用程序,它使用单声道中 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中单声道中的SerialPort不响应DataReceived事件

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

发布评论

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

>www.elefans.com

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