コード例 #1
0
        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));
        }
コード例 #2
0
 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;*/
 }
コード例 #3
0
        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);
                }
            }
        }
コード例 #4
0
        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);
                }
            }
        }
コード例 #5
0
        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);
                }
            }
        }
コード例 #6
0
 private void SerialPort_PinChanged(object source, SerialPorts.SerialEventArgs e)
 {
 }
コード例 #7
0
 private void SerialPort_Error(object source, SerialPorts.SerialEventArgs e)
 {
 }
コード例 #8
0
 void SerialPortPinChangedEvent(object source, SerialPorts.SerialEventArgs e)
 {
 }
コード例 #9
0
 void SerialPortErrorEvent(object source, SerialPorts.SerialEventArgs e)
 {
 }
コード例 #10
0
		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);   
		} 
コード例 #11
0
		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);
			}	
		}
コード例 #12
0
		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);
			}
		}