<legend id='HUWzG'><style id='HUWzG'><dir id='HUWzG'><q id='HUWzG'></q></dir></style></legend>
    <bdo id='HUWzG'></bdo><ul id='HUWzG'></ul>
<i id='HUWzG'><tr id='HUWzG'><dt id='HUWzG'><q id='HUWzG'><span id='HUWzG'><b id='HUWzG'><form id='HUWzG'><ins id='HUWzG'></ins><ul id='HUWzG'></ul><sub id='HUWzG'></sub></form><legend id='HUWzG'></legend><bdo id='HUWzG'><pre id='HUWzG'><center id='HUWzG'></center></pre></bdo></b><th id='HUWzG'></th></span></q></dt></tr></i><div id='HUWzG'><tfoot id='HUWzG'></tfoot><dl id='HUWzG'><fieldset id='HUWzG'></fieldset></dl></div>
<tfoot id='HUWzG'></tfoot>
  • <small id='HUWzG'></small><noframes id='HUWzG'>

      1. 连接打开时更改 SerialPort 的 BaudRate

        Change SerialPort#39;s BaudRate while connection is open(连接打开时更改 SerialPort 的 BaudRate)

            1. <i id='zUIkZ'><tr id='zUIkZ'><dt id='zUIkZ'><q id='zUIkZ'><span id='zUIkZ'><b id='zUIkZ'><form id='zUIkZ'><ins id='zUIkZ'></ins><ul id='zUIkZ'></ul><sub id='zUIkZ'></sub></form><legend id='zUIkZ'></legend><bdo id='zUIkZ'><pre id='zUIkZ'><center id='zUIkZ'></center></pre></bdo></b><th id='zUIkZ'></th></span></q></dt></tr></i><div id='zUIkZ'><tfoot id='zUIkZ'></tfoot><dl id='zUIkZ'><fieldset id='zUIkZ'></fieldset></dl></div>
            2. <legend id='zUIkZ'><style id='zUIkZ'><dir id='zUIkZ'><q id='zUIkZ'></q></dir></style></legend>
                <tbody id='zUIkZ'></tbody>
            3. <tfoot id='zUIkZ'></tfoot>

              <small id='zUIkZ'></small><noframes id='zUIkZ'>

                <bdo id='zUIkZ'></bdo><ul id='zUIkZ'></ul>
                  本文介绍了连接打开时更改 SerialPort 的 BaudRate的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在使用 SerialPort 类与外部设备进行通信.我以每秒 300 波特的速度开始通信,但是在初始握手"之后,我必须切换到设备指定的波特率(通常为 9600 Bps).

                  I am using SerialPort class to communicate with an external device. I start the communication at 300 Baud per second however after the initial "handshake" I have to switch to a Baud rate specified by the device (usually 9600 Bps).

                  我在提高波特率后尝试继续通信没有成功,但我不知道为什么.这引出了我的问题:改变波特率的正确方法是什么?可以在连接打开时完成,还是我应该先关闭连接?

                  I have been unsuccessful in my attempts to continue communicating after I increase Baud rate however I am not sure why. That leads me to my question: What is the proper way of changing the Baud rate? Can it be done while the connection is open, or should I close the connection first?

                  我无法在文档中找到有关此的任何信息...

                  I have been unable to find any information about this in the documentation...

                  我都尝试过,但都没有成功,这让我觉得我一定错过了一些明显的东西.

                  I have tried both and have been unsuccessful in both ways, which made me think that I must be missing something obvious.

                  推荐答案

                  原来你可以在 SerialPort.BaudRate 打开的时候改变它.但是@Groo 在回答中提到的 SerialPort.DiscardInBuffer 是一个很好的提示!

                  It turns out you can change SerialPort.BaudRate while it is open. But the SerialPort.DiscardInBuffer that is mentioned in answer by @Groo is a good tip!

                  这篇关于连接打开时更改 SerialPort 的 BaudRate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Multicast delegate weird behavior in C#?(C# 中的多播委托奇怪行为?)
                  Parameter count mismatch with Invoke?(参数计数与调用不匹配?)
                  How to store delegates in a List(如何将代表存储在列表中)
                  How delegates work (in the background)?(代表如何工作(在后台)?)
                  C# Asynchronous call without EndInvoke?(没有 EndInvoke 的 C# 异步调用?)
                  Delegate.CreateDelegate() and generics: Error binding to target method(Delegate.CreateDelegate() 和泛型:错误绑定到目标方法)

                  <small id='IkedX'></small><noframes id='IkedX'>

                    <tbody id='IkedX'></tbody>
                    • <legend id='IkedX'><style id='IkedX'><dir id='IkedX'><q id='IkedX'></q></dir></style></legend>

                      • <bdo id='IkedX'></bdo><ul id='IkedX'></ul>
                        <tfoot id='IkedX'></tfoot>

                            <i id='IkedX'><tr id='IkedX'><dt id='IkedX'><q id='IkedX'><span id='IkedX'><b id='IkedX'><form id='IkedX'><ins id='IkedX'></ins><ul id='IkedX'></ul><sub id='IkedX'></sub></form><legend id='IkedX'></legend><bdo id='IkedX'><pre id='IkedX'><center id='IkedX'></center></pre></bdo></b><th id='IkedX'></th></span></q></dt></tr></i><div id='IkedX'><tfoot id='IkedX'></tfoot><dl id='IkedX'><fieldset id='IkedX'></fieldset></dl></div>