SerialPort.BreakState 属性

定义

获取或设置中断信号状态。Gets or sets the break signal state.

public:
 property bool BreakState { bool get(); void set(bool value); };
public bool BreakState { get; set; }
[System.ComponentModel.Browsable(false)]
public bool BreakState { get; set; }
member this.BreakState : bool with get, set
[<System.ComponentModel.Browsable(false)>]
member this.BreakState : bool with get, set
Public Property BreakState As Boolean

属性值

Boolean

如果端口处于中断状态,则为 true;否则为 falsetrue if the port is in a break state; otherwise, false.

属性

例外

此端口处于无效状态。The port is in an invalid state.

- 或 --or- 尝试设置基础端口状态失败。An attempt to set the state of the underlying port failed. 例如,从此 SerialPort 对象传递的参数无效。For example, the parameters passed from this SerialPort object were invalid.

流已关闭。The stream is closed. 这可能会因为尚未调用 Open() 方法或已调用了 Close() 方法而发生。This can occur because the Open() method has not been called or the Close() method has been called.

注解

当传输暂停且线路处于中断状态时, (所有低、无停止位) 直到释放时,中断信号状态。The break signal state occurs when a transmission is suspended and the line is placed in a break state (all low, no stop bit) until released. 若要进入中断状态,请将此属性设置为 trueTo enter a break state, set this property to true. 如果端口已处于中断状态,则再次将该属性设置为不 true 会导致异常。If the port is already in a break state, setting this property again to true does not result in an exception. 在为时,不能写入 SerialPort 对象 BreakState trueIt is not possible to write to the SerialPort object while BreakState is true.

适用于