G
Graham McKechnie
I mentioned in an earlier thread (Exceptions) that I was having problems
with SerialPort.Close.
I've now modified my Close as follows and I have seemed to overcome that
particular problem
if (this.serialPort.IsOpen)
{
try
{
this.serialPort.ReadTimeout = 0;
this.serialPort.Close();
}
catch (Exception ex)
{
throw new Exception("Failed to close serial port", ex);
}
}
Without the ReadTimeout = 0, it appears to just hang and the GPS lights on
the unit keep on flashing as they do when receiving data - same on 2
different units
Anyone have any ideas why this is necessary or are you not having problems
closing a serial port with the new SerialPort class?
Regards
Graham
with SerialPort.Close.
I've now modified my Close as follows and I have seemed to overcome that
particular problem
if (this.serialPort.IsOpen)
{
try
{
this.serialPort.ReadTimeout = 0;
this.serialPort.Close();
}
catch (Exception ex)
{
throw new Exception("Failed to close serial port", ex);
}
}
Without the ReadTimeout = 0, it appears to just hang and the GPS lights on
the unit keep on flashing as they do when receiving data - same on 2
different units
Anyone have any ideas why this is necessary or are you not having problems
closing a serial port with the new SerialPort class?
Regards
Graham