예제 #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);
 }
예제 #8
0
 /// <summary>
 /// Событие происходящее при какой-либо ошибке
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void DataError(object sender,SerialErrorReceivedEventArgs e)
 {
 }
예제 #9
0
 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();
 }
예제 #12
0
 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
파일: RS232Class.cs 프로젝트: sshakuf/mdop
 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
파일: CommPort.cs 프로젝트: litdev1/LitDev
 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
파일: NXTBox.cs 프로젝트: acj4/nxt-ucontrol
 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(); }));
 }
예제 #40
0
 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);
 }
예제 #47
0
 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)
 {
 }
예제 #50
0
 private void error(Object sender, SerialErrorReceivedEventArgs e)
 {
     comErrorsReceived++;
     log("Serial com error:" + e.ToString(), false, 2);
     if (comErrorsReceived == 10)
         close();
 }