本文介绍了[UWP] [C#]发送大量数据后串口不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


我正在开展一个项目,我必须建立一个从Raspberyy Pi 3到ATmega8微控制器的串行通信。


到目前为止,我设法在两个设备之间编写了有效的通信。但现在我有一个大问题。我使用小(8-10字节)命令从微控制器获取数据块,然后在我的应用程序中显示它们。一些数据可以在我的
应用程序中更改,然后我将更改后的数据发送回控制器(大约400字节)。


我现在的问题是,大多数我能够将数据发送回一次然后在不重新启动端口/或我的应用程序的情况下再也无法使用串行端口的时间。我可以正常取消任务,但我仍然无法使用该端口。即使是
较短的命令也不再响应。


有人能想出这个问题的原因吗?如果需要,我可以编写一个只有基本功能的小代码示例,以便更好地理解。


问候,


Daniel

解决方案

Hello there,

I'm currently working on a project where I have to build a serial communication from a Raspberyy Pi 3 to a ATmega8 microcontroller.

So far I managed to write a working communication between both devices. But now I have a big problem. I use small (8-10 bytes) commands to get blocks of data from the microcontroller and then I display them in my app. Some of the data can be changed in my app and then I send the changed data back to the controller (about 400 bytes).

My problem now is, that most of the time I'm able to send the data back just once and then I'm not able to use the serial port anymore without restarting the port/ or my app. I can cancel the task just fine but I'm still unable to use the port. Even the shorter commands don't respond anymore.

Does anybody can think of a cause for this problem? If needed I can write a small code sample with just the basic functionality for better understanding.

Greetings,

Daniel

解决方案


这篇关于[UWP] [C#]发送大量数据后串口不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-09 21:49