D
David White
Hello,
I am working to port an existing application from .net 1.1 to 2.0 and we hope
to employ the new SerialPort class. In our application, the SerialPort class
instance is "wired" to a virtual serial port that is Win32-based. So when
changes take place to the virtual port, we need to migrate those changes to the
serial port and vis-a-vis. The previous version of our code was using a serial
port class based on the Win32 API (derived from the one found at
<http://msdn.microsoft.com/msdnmag/issues/02/10/netserialcomm/default.aspx>).
In porting to the .net 2 SerialPort, I have a few issues:
I am having some confusion about how to map the Win32 notion of serial port
timeouts to that in the .Net 2 SerialPort class. The new class offers a single
property each for ReadTimeout and WriteTimeout. These are documented as:
"Gets or sets the number of milliseconds before a time-out occurs when a read
(or write) operation does not finish."
In the Win32 API, timeouts do not seem this simple and they do not seem to map
easily as their values are based since the last byte was received or sent and
their are multipliers and constants.
Has anyone out there managed to make any sense of how to map the Win32 API
sense of timeouts to that in the new .Net class?
Also, the same thing seems an issue with the idea of Hanshaking? Any
suggestions here?
Thanks,
David
I am working to port an existing application from .net 1.1 to 2.0 and we hope
to employ the new SerialPort class. In our application, the SerialPort class
instance is "wired" to a virtual serial port that is Win32-based. So when
changes take place to the virtual port, we need to migrate those changes to the
serial port and vis-a-vis. The previous version of our code was using a serial
port class based on the Win32 API (derived from the one found at
<http://msdn.microsoft.com/msdnmag/issues/02/10/netserialcomm/default.aspx>).
In porting to the .net 2 SerialPort, I have a few issues:
I am having some confusion about how to map the Win32 notion of serial port
timeouts to that in the .Net 2 SerialPort class. The new class offers a single
property each for ReadTimeout and WriteTimeout. These are documented as:
"Gets or sets the number of milliseconds before a time-out occurs when a read
(or write) operation does not finish."
In the Win32 API, timeouts do not seem this simple and they do not seem to map
easily as their values are based since the last byte was received or sent and
their are multipliers and constants.
Has anyone out there managed to make any sense of how to map the Win32 API
sense of timeouts to that in the new .Net class?
Also, the same thing seems an issue with the idea of Hanshaking? Any
suggestions here?
Thanks,
David