本文整理汇总了C#中System.IO.Ports.SerialErrorReceivedEventArgs类的典型用法代码示例。如果您正苦于以下问题:C# SerialErrorReceivedEventArgs类的具体用法?C# SerialErrorReceivedEventArgs怎么用?C# SerialErrorReceivedEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SerialErrorReceivedEventArgs类属于System.IO.Ports命名空间,在下文中一共展示了SerialErrorReceivedEventArgs类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ErrorReceivedHandler
private void ErrorReceivedHandler(object sender, SerialErrorReceivedEventArgs e)
{
// TODO processing error message here
string message = "";
switch (e.EventType)
{
case SerialError.Frame:
message = "Framing error ";
break;
case SerialError.Overrun:
message = "character-buffer overrun ";
break;
case SerialError.RXOver:
message = "Input buffer overflow";
break;
case SerialError.RXParity:
message = "parity error pada hardware";
break;
case SerialError.TXFull:
message = "transmit data, namun output buffer sedang penuh";
break;
}
if (null != ErrorData)
{
ErrorData(message);
}
}
示例2: ErrorRecieved
private static void ErrorRecieved(object sender, SerialErrorReceivedEventArgs e)
{
SerialPort serialPort = sender as SerialPort;
if (serialPort != null)
{
Console.WriteLine("Error recieved. Port name: {0}.", serialPort.PortName);
}
}
示例3: ErrorEvent
public void ErrorEvent(object sender, SerialErrorReceivedEventArgs e)
{
if (ErrorHandler != null)
{
ErrorHandler(sender, e);
}
}
示例4: Sp_ErrorReceived
private static void Sp_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
Console.WriteLine();
sp.Close();
Console.WriteLine(e.EventType.ToString());
Console.ReadLine();
Console.WriteLine();
}
示例5: TestSerialPort_ErrorReceived
void TestSerialPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
Log.Exception("TestSerialPort Error Rcvd event fired.");
string type = "";
switch (e.EventType)
{
case SerialError.Frame:
type = "Frame";
break;
case SerialError.Overrun:
type = "Overrun";
break;
case SerialError.RXOver:
type = "RXOver";
break;
case SerialError.RXParity:
type = "RXParity";
break;
case SerialError.TXFull:
type = "TXFull";
break;
}
Log.Comment("Event Type: " + type);
}
示例6: m_serialPort_ErrorReceived
void m_serialPort_ErrorReceived(object sender,
SerialErrorReceivedEventArgs e)
{
if (ErrorReceived != null)
ErrorReceived(sender, e);
}
示例7: SerialErrorReceived
private static void SerialErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
Log.Add(Log.Severity.Debug, "SerialErrorReceived(): {0}", e.EventType);
}
示例8: _port_ErrorReceived
void _port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
if(_evtHandler != null)
{
_evtHandler(_portIndex, (uint)SerialPortEventErrors.USART_EVENT_TYPE_ERROR);
}
}
示例9: OnErrorReceived
internal void OnErrorReceived (SerialErrorReceivedEventArgs args)
{
SerialErrorReceivedEventHandler handler =
(SerialErrorReceivedEventHandler) Events [error_received];
if (handler != null)
handler (this, args);
}
示例10: comport_ErrorReceived
void comport_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
txtReceive.Invoke(new EventHandler(delegate { txtReceive.Text += e.ToString(); }));
}
示例11: MyPort_ErrorReceived
private void MyPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
throw new SerialError();
}
示例12: Port_ErrorReceived
//TODO реализовать при необходимости
private void Port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
{
Debug.WriteLine("Port_ErrorReceived");
}
示例13: error
private void error(Object sender, SerialErrorReceivedEventArgs e)
{
comErrorsReceived++;
log("Serial com error:" + e.ToString(), false, 2);
if (comErrorsReceived == 10)
close();
}
示例14: CatchErrorEvents
private void CatchErrorEvents(object src, SerialErrorReceivedEventArgs e)
{
SerialErrorReceivedEventHandler errorReceived = this.ErrorReceived;
SerialStream internalSerialStream = this.internalSerialStream;
if ((errorReceived != null) && (internalSerialStream != null))
{
lock (internalSerialStream)
{
if (internalSerialStream.IsOpen)
{
errorReceived(this, e);
}
}
}
}
示例15: ErrorReceivedHandler
private void ErrorReceivedHandler(object sender, SerialErrorReceivedEventArgs e)
{
Debug.Print("Serial error received with type: " + e.EventType);
}