示例#1
1
 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
1
        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
0
 public void ErrorEvent(object sender, SerialErrorReceivedEventArgs e)
 {
     if (ErrorHandler != null)
     {
         ErrorHandler(sender, e);
     }
 }
示例#4
0
 void serial_ErrorReceived(object sender, Ports.SerialErrorReceivedEventArgs e)
 {
     if (ErrorReceived != null)
     {
         ErrorReceived(this, e);
     }
 }
 private static void Sp_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     Console.WriteLine();
     sp.Close();
     Console.WriteLine(e.EventType.ToString());
     Console.ReadLine();
     Console.WriteLine();
 }
示例#6
0
        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);
                    }
                }
            }
        }
示例#7
0
 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);
 }
 /// <summary>
 /// Событие происходящее при какой-либо ошибке
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void DataError(object sender,SerialErrorReceivedEventArgs e)
 {
 }
 void m_port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
 }
示例#10
0
 private void Roomba_DataErrorRecieved(object sender, SerialErrorReceivedEventArgs e)
 {
     string m_sReturn = Program.UI.CurrentRoomba.IO.ReadExisting();
         m_bRCV_Err = true;
 }
示例#11
0
 void serialPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     //MessageBox.Show();
     throw new NotImplementedException();
 }
 private void error(Object sender, SerialErrorReceivedEventArgs e)
 {
     log("Serial com error:" + e.ToString(), false, 2);
 }
示例#13
0
 void eventSerialPort_ErrorReceived_AfterOpen(object sender, SerialErrorReceivedEventArgs e)
 {
     if (e.EventType == expectedError)
     {
         if (eventCount == 0)
         {
             Log.Comment("AfterOpen event fired.  Event Type: " + e.EventType);
         }
         eventCount++;
     }
     // with loopback you can't get a TxFull without an RX FULL
     else if (!(e.EventType == SerialError.RXOver && expectedError == SerialError.TXFull))
     {
         Log.Exception("Expected EventType " + expectedError + " but received EventType " + e.EventType);
         result = MFTestResults.Fail;
     }
 }
示例#14
0
 //TODO реализовать при необходимости
 private void Port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     Debug.WriteLine("Port_ErrorReceived");
 }
示例#15
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
 }
示例#16
0
 public void comPort_ErrorReceived(Object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     MessageBox.Show(">ERR>>>>>>>>>>>>>>>>>>>>>>>>>>>" + comPort.ReadExisting() + "\n\r");
     //   sipXtapi.Interop.sipXtapi.sipxCallReject(CurrCall, 400, "BUSY HERE");
 }
示例#17
0
        void m_serialPort_ErrorReceived(object sender,
		SerialErrorReceivedEventArgs e)
        {
            if (ErrorReceived != null)
            ErrorReceived(sender, e);
        }
示例#18
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     this.Invoke(new writeToLogDelegate(writeToLog), false, true, e.EventType.ToString());
 }
示例#19
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     richTextBox2.AppendText("ErrorReceived");
 }
示例#20
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     XtraMessageBox.Show("接收数据时发生错误:" + e.EventType);
 }
示例#21
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     logEvent("Error Received! " + e.EventType.ToString());
 }
示例#22
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     this.SetText("[异常]x" + e.EventType.ToString());
 }
示例#23
0
 private static void SerialErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     Log.Add(Log.Severity.Debug, "SerialErrorReceived(): {0}", e.EventType);
 }
示例#24
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     MessageBox.Show("Port1 error: " + e.EventType);
 }
 private void SP_Joy_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     Close_Serial_Port(SP_Joy);
     MessageBox.Show("Erreur sur le port série !\n\n" + e.ToString(), "Erreur", MessageBoxButtons.OK, MessageBoxIcon.Error);
 }
示例#26
0
 void port_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     //spinfo.Text += "" + e.ToString(); //MessageBox.Show("error port:" + e.ToString());
 }
示例#27
0
 void serialPort1_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     //throw new NotImplementedException();
 }
示例#28
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     SetText("COM port error\r\n");
 }
示例#29
0
 private void _serialPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     SerialError err = e.EventType;
     _labelConnectionState.Text = "ERR=" + err.ToString();
 }
        void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
        {
            this.toolStripStatusLabel1.Text = "Error event trapped from Serial Port";

            MessageBox.Show(this, "Error received", "Serial Port Event", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
 void myPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     myPort.DiscardInBuffer();
     myPort.DiscardOutBuffer();
     EventLogger.LogMessage("Serial Error Received. Discarding both buffers", System.Diagnostics.TraceLevel.Error);
 }
示例#32
0
 private void serialPort1_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     //RxString = "Serial: Error!" + "\r\n";
     //this.Invoke(new EventHandler(DisplayText));
 }
示例#33
0
 /// <summary>
 /// 错误处理函数
 /// </summary>
 void comPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     if (Error != null)
     {
         Error(sender, e);
     }
 }
示例#34
0
 private void serialPort_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     MessageBox.Show(e.ToString());
 }
示例#35
0
 private static void ErrorReceivedEvent(Object sender, SerialErrorReceivedEventArgs e)
 {
     lastPort = ((SerialPort)sender).PortName;
     lastError = e.EventType.ToString();
     if (null != ErrorReceivedDelegate) ErrorReceivedDelegate();
 }
示例#36
0
 /// <summary>
 /// Fires an event when a COM port operation results in an error
 /// </summary>
 /// <param name="sender">Sending object</param>
 /// <param name="e">Serial Port event args instance</param>
 private void ErrorReceivedTrigger(object sender, SerialComPort.SerialErrorReceivedEventArgs e)
 {
     LogError(e.EventType.ToString());
 }
示例#37
0
 private void MyPort_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     throw new SerialError();
 }
示例#38
0
 /// <summary>
 /// Called when a serial communication error occurs.
 /// </summary>
 private void UartErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     // TODO
     if (this.ObdErrorEvent != null)
     {
         this.ObdErrorEvent(this, new ErrorEventArgs(new Exception(e.ToString())));
     }
 }
示例#39
0
 void comport_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     txtReceive.Invoke(new EventHandler(delegate { txtReceive.Text += e.ToString(); }));
 }
 private void error(Object sender, SerialErrorReceivedEventArgs e)
 {
     comErrorsReceived++;
     log(Trans.T("L_SERIAL_COM_ERROR") + e.ToString(), false, 2); // "Serial com error:"
     if (comErrorsReceived == 10)
         close();
 }
示例#41
0
		internal void OnErrorReceived (SerialErrorReceivedEventArgs args)
		{
			SerialErrorReceivedEventHandler handler =
				(SerialErrorReceivedEventHandler) Events [error_received];

			if (handler != null)
				handler (this, args);
		}
示例#42
0
 private void SerialPort_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     WriteInfo("Ошибка при чтении: " + e.EventType);
 }
示例#43
0
 void _port_ErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     if(_evtHandler != null)
     {
         _evtHandler(_portIndex, (uint)SerialPortEventErrors.USART_EVENT_TYPE_ERROR);
     }
 }
示例#44
0
 private void port_ErrorReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     Utility.WriteToTraceLog(string.Format("SerialPort: Error received data '{0}'", e.EventType.ToString()));
 }
示例#45
0
 private void RsPort_ErrReceived(object sender, System.IO.Ports.SerialErrorReceivedEventArgs e)
 {
     PortOpen();
     RequestSend();
 }
示例#46
0
 private void ErrorReceivedHandler(object sender, SerialErrorReceivedEventArgs e)
 {
     Debug.Print("Serial error received with type: " + e.EventType);
 }
 private void HandleErrorReceived(object sender, SerialErrorReceivedEventArgs e)
 {
     logger.Error(e.EventType);
 }
 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);
             }
         }
     }
 }
示例#49
0
 protected virtual void ErrorReceivedHandler(object sender, SerialErrorReceivedEventArgs e)
 {
 }
 private void error(Object sender, SerialErrorReceivedEventArgs e)
 {
     comErrorsReceived++;
     log("Serial com error:" + e.ToString(), false, 2);
     if (comErrorsReceived == 10)
         close();
 }