void SerialPortReceivedEvent(object source, SerialPorts.SerialEventArgs e) { int num_to_read = commPort.InBufferBytes; byte[] inbuf = new byte[num_to_read]; commPort.Read(inbuf, 0, num_to_read); serial_rx_event(this, new SDRSerialSupportII.SerialRXEvent(inbuf, (uint)num_to_read)); }
private void SerialPort_ReceivedData(object source, SerialPorts.SerialEventArgs e) { /*Debug.Write("Serial Debug: "); * while(com_port.InBufferBytes > 0) * Debug.Write(com_port.ReadByte().ToString("X")+" "); * Debug.WriteLine("");*/ /*string s = com_port.ReadLine(); * Debug.WriteLine("Serial Debug: "+s); * if(s[1] == 'D') * last_rx = s;*/ }
private void CatchPinChangedEvents(object src, SerialEventArgs e) { int eventsCaught = (int)e.EventType & (int)eventFilter; if (((eventsCaught & (int)(SerialEvents.CDChanged | SerialEvents.CtsChanged | SerialEvents.DsrChanged | SerialEvents.Ring | SerialEvents.Break)) != 0)) { if (PinChangedEvent != null) { PinChangedEvent(src, e); } } }
private void CatchReceivedEvents(object src, SerialEventArgs e) { int eventsCaught = (int)e.EventType & (int)eventFilter; int inBufferBytes = InBufferBytes; if (((eventsCaught & (int)(SerialEvents.ReceivedChars | SerialEvents.EofReceived)) != 0) && (InBufferBytes >= receivedBytesThreshold)) { if (ReceivedEvent != null) { ReceivedEvent(src, e); } } }
private void CatchErrorEvents(object src, SerialEventArgs e) { int eventsCaught = (int)e.EventType & (int)eventFilter; if ((eventsCaught & (int)(SerialEvents.Frame | SerialEvents.Overrun | SerialEvents.RxOver | SerialEvents.RxParity | SerialEvents.TxFull)) != 0) { if (ErrorEvent != null) { ErrorEvent(src, e); } } }
private void SerialPort_PinChanged(object source, SerialPorts.SerialEventArgs e) { }
private void SerialPort_Error(object source, SerialPorts.SerialEventArgs e) { }
void SerialPortPinChangedEvent(object source, SerialPorts.SerialEventArgs e) { }
void SerialPortErrorEvent(object source, SerialPorts.SerialEventArgs e) { }
private void CatchReceivedEvents(object src, SerialEventArgs e) { int eventsCaught = (int) e.EventType & (int) eventFilter; int inBufferBytes = InBufferBytes; if (((eventsCaught & (int) (SerialEvents.ReceivedChars | SerialEvents.EofReceived)) != 0) && (InBufferBytes >= receivedBytesThreshold)) if (ReceivedEvent != null) ReceivedEvent(src, e); }
private void CatchPinChangedEvents(object src, SerialEventArgs e) { int eventsCaught = (int) e.EventType & (int) eventFilter; if (((eventsCaught & (int) (SerialEvents.CDChanged | SerialEvents.CtsChanged | SerialEvents.DsrChanged | SerialEvents.Ring | SerialEvents.Break)) != 0)) { if (PinChangedEvent != null) PinChangedEvent(src, e); } }
private void CatchErrorEvents(object src, SerialEventArgs e) { int eventsCaught = (int) e.EventType & (int) eventFilter; if ((eventsCaught & (int) (SerialEvents.Frame | SerialEvents.Overrun | SerialEvents.RxOver | SerialEvents.RxParity | SerialEvents.TxFull)) != 0) { if (ErrorEvent != null) ErrorEvent(src, e); } }