当前位置: 首页>>代码示例>>C#>>正文


C# Ports.SerialErrorReceivedEventArgs类代码示例

本文整理汇总了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);
     }
 }
开发者ID:ibnoe,项目名称:parkir,代码行数:27,代码来源:SerialComPort.cs

示例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);
            }
        }
开发者ID:AntonPashkowskiy,项目名称:Labs,代码行数:9,代码来源:Program.cs

示例3: ErrorEvent

 public void ErrorEvent(object sender, SerialErrorReceivedEventArgs e)
 {
     if (ErrorHandler != null)
     {
         ErrorHandler(sender, e);
     }
 }
开发者ID:hpbaotho,项目名称:top4ever-pos,代码行数:7,代码来源:SerialPortHelper.cs

示例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();
 }
开发者ID:AlistairCheeseman,项目名称:WindTunnelApparatus,代码行数:8,代码来源:Program.cs

示例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);
 }
开发者ID:awakegod,项目名称:NETMF-LPC,代码行数:24,代码来源:TestSerialPort.cs

示例6: m_serialPort_ErrorReceived

        void m_serialPort_ErrorReceived(object sender,
		SerialErrorReceivedEventArgs e)
        {
            if (ErrorReceived != null)
            ErrorReceived(sender, e);
        }
开发者ID:calimeradriver,项目名称:Domotica,代码行数:6,代码来源:DnSerialPort.cs

示例7: SerialErrorReceived

 private static void SerialErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     Log.Add(Log.Severity.Debug, "SerialErrorReceived(): {0}", e.EventType);
 }
开发者ID:astrospark,项目名称:LazerTagHost,代码行数:4,代码来源:LazerTagSerial.cs

示例8: _port_ErrorReceived

 void _port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     if(_evtHandler != null)
     {
         _evtHandler(_portIndex, (uint)SerialPortEventErrors.USART_EVENT_TYPE_ERROR);
     }
 }
开发者ID:koson,项目名称:.NETMF_for_LPC17xx,代码行数:7,代码来源:SerialPort.cs

示例9: OnErrorReceived

		internal void OnErrorReceived (SerialErrorReceivedEventArgs args)
		{
			SerialErrorReceivedEventHandler handler =
				(SerialErrorReceivedEventHandler) Events [error_received];

			if (handler != null)
				handler (this, args);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:8,代码来源:SerialPort.cs

示例10: comport_ErrorReceived

 void comport_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     txtReceive.Invoke(new EventHandler(delegate { txtReceive.Text += e.ToString(); }));
 }
开发者ID:andrejpanic,项目名称:win-mobile-code,代码行数:4,代码来源:Form1.cs

示例11: MyPort_ErrorReceived

 private void MyPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     throw new SerialError();
 }
开发者ID:acj4,项目名称:nxt-ucontrol,代码行数:4,代码来源:NXTBox.cs

示例12: Port_ErrorReceived

 //TODO реализовать при необходимости
 private void Port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     Debug.WriteLine("Port_ErrorReceived");
 }
开发者ID:alexrigin,项目名称:HMS2,代码行数:5,代码来源:MitutoyoRS232InputDevice.cs

示例13: error

 private void error(Object sender, SerialErrorReceivedEventArgs e)
 {
     comErrorsReceived++;
     log("Serial com error:" + e.ToString(), false, 2);
     if (comErrorsReceived == 10)
         close();
 }
开发者ID:CNCBASHER,项目名称:Repetier-Host,代码行数:7,代码来源:PrinterConnection.cs

示例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);
             }
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:15,代码来源:SerialPort.cs

示例15: ErrorReceivedHandler

 private void ErrorReceivedHandler(object sender, SerialErrorReceivedEventArgs e)
 {
     Debug.Print("Serial error received with type: " + e.EventType);
 }
开发者ID:kmarcell,项目名称:IoTFrameworks,代码行数:4,代码来源:XbeeCoordinator.cs


注:本文中的System.IO.Ports.SerialErrorReceivedEventArgs类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。