Exemplo n.º 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));
        }
Exemplo n.º 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;*/
 }
Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 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);
                }
            }
        }
Exemplo n.º 6
0
 private void SerialPort_PinChanged(object source, SerialPorts.SerialEventArgs e)
 {
 }
Exemplo n.º 7
0
 private void SerialPort_Error(object source, SerialPorts.SerialEventArgs e)
 {
 }
Exemplo n.º 8
0
 void SerialPortPinChangedEvent(object source, SerialPorts.SerialEventArgs e)
 {
 }
Exemplo n.º 9
0
 void SerialPortErrorEvent(object source, SerialPorts.SerialEventArgs e)
 {
 }
Exemplo n.º 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);   
		} 
Exemplo n.º 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);
			}	
		}
Exemplo n.º 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);
			}
		}