SerialError SerialError SerialError SerialError Enum

定义

指定在 SerialPort 对象上发生的错误。Specifies errors that occur on the SerialPort object.

public enum class SerialError
public enum SerialError
type SerialError = 
Public Enum SerialError
继承

字段

Frame Frame Frame Frame 8

硬件检测到一个组帧错误。The hardware detected a framing error.

Overrun Overrun Overrun Overrun 2

发生字符缓冲区溢出。A character-buffer overrun has occurred. 下一个字符将丢失。The next character is lost.

RXOver RXOver RXOver RXOver 1

发生输入缓冲区溢出。An input buffer overflow has occurred. 输入缓冲区空间不足,或在文件尾 (EOF) 字符之后接收到字符。There is either no room in the input buffer, or a character was received after the end-of-file (EOF) character.

RXParity RXParity RXParity RXParity 4

硬件检测到奇偶校验错误。The hardware detected a parity error.

TXFull TXFull TXFull TXFull 256

应用程序尝试传输一个字符,但是输出缓冲区已满。The application tried to transmit a character, but the output buffer was full.

注解

在处理时,此枚举可能很有用ErrorReceived事件来检测和响应错误通信通过数据时SerialPortThis enumeration can be useful when handling the ErrorReceived event to detect and respond to errors when communicating data through a SerialPort. 通过检索 ReceivedEventArgs 类的 ReceivedEventArgs.EventType 属性检查错误的类型。You examine the type of error by retrieving the ReceivedEventArgs.EventType property of the ReceivedEventArgs class. ReceivedEventArgs.EventType 属性包含一个从值EventType枚举。The ReceivedEventArgs.EventType property contains one of the values from the EventType enumeration.

适用于