[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Dotgnu-pnet-commits] pnetlib/System/IO/Ports SerialPort.cs, 1.2, 1.3
From: |
Rhys Weatherley <address@hidden> |
Subject: |
[Dotgnu-pnet-commits] pnetlib/System/IO/Ports SerialPort.cs, 1.2, 1.3 |
Date: |
Sat, 08 Nov 2003 11:34:37 +0000 |
Update of /cvsroot/dotgnu-pnet/pnetlib/System/IO/Ports
In directory subversions:/tmp/cvs-serv25158/System/IO/Ports
Modified Files:
SerialPort.cs
Log Message:
Minor tweaks to the serial port routines.
Index: SerialPort.cs
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnetlib/System/IO/Ports/SerialPort.cs,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** SerialPort.cs 8 Nov 2003 05:52:55 -0000 1.2
--- SerialPort.cs 8 Nov 2003 11:34:34 -0000 1.3
***************
*** 45,48 ****
--- 45,50 ----
private String newLine;
private byte[] newLineBuffer;
+ private SerialPinChangedEventHandler pinChanged;
+ private SerialReceivedEventHandler received;
private static readonly int[] validBaudRates =
{50, 75, 110, 134, 150, 200, 300, 600, 1200,
***************
*** 926,933 ****
}
! // Events that may be emitted by the serial port.
public event SerialErrorEventHandler ErrorEvent;
! public event SerialPinChangedEventHandler PinChangedEvent;
! public event SerialReceivedEventHandler ReceivedEvent;
// Stream class that wraps up a serial port.
--- 928,991 ----
}
! // Event that is emitted when an error occurs (ignored in this version).
public event SerialErrorEventHandler ErrorEvent;
!
! // Event that is emitted when incoming serial pins change state.
! [TODO]
! public event SerialPinChangedEventHandler PinChangedEvent
! {
! add
! {
! lock(this)
! {
! bool empty = (pinChanged ==
null);
! pinChanged = pinChanged + value;
! if(empty && pinChanged != null)
! {
! // TODO: launch the pin
notification thread.
! }
! }
! }
! remove
! {
! lock(this)
! {
! pinChanged = pinChanged - value;
! if(pinChanged == null)
! {
! // TODO: shut down the
pin notification thread.
! }
! }
! }
! }
!
! // Event that is emitted when data is received.
! [TODO]
! public event SerialReceivedEventHandler ReceivedEvent
! {
! add
! {
! lock(this)
! {
! bool empty = (received == null);
! received = received + value;
! if(empty && received != null)
! {
! // TODO: launch the
data received thread.
! }
! }
! }
! remove
! {
! lock(this)
! {
! received = received - value;
! if(received == null)
! {
! // TODO: shut down the
data received thread.
! }
! }
! }
! }
// Stream class that wraps up a serial port.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Dotgnu-pnet-commits] pnetlib/System/IO/Ports SerialPort.cs, 1.2, 1.3,
Rhys Weatherley <address@hidden> <=