[Mono-list] TimeoutException on SerialPort (mono 2.0)

eyanson eyanson at gmail.com
Thu Dec 18 17:31:23 EST 2008


I found the problem, but I dont understant the real problem.

In the sample on "http://www.mono-project.com/HowToSystemIOPorts"
exist it code:

while (tmpByte != 255) {
      rxString += ((char) tmpByte);
      tmpByte = (byte) mySerial.ReadByte();
}

The problem is that spect a byte with 255 but the modem never send a 255.
The sample is incorrect or I have antoher problem??????

thanks !!!!



eyanson wrote:
> 
> I tested this sample: http://www.mono-project.com/HowToSystemIOPorts
> 
> but I get this error:
> 
> Unhandled Exception: System.TimeoutException: The operation has timed-out.
>   at System.IO.Ports.SerialPortStream.Read (System.Byte[] buffer, Int32
> offset, Int32 count) [0x00000] 
>   at System.IO.Ports.SerialPort.read_byte () [0x00000] 
>   at System.IO.Ports.SerialPort.ReadByte () [0x00000] 
>   at (wrapper remoting-invoke-with-check)
> System.IO.Ports.SerialPort:ReadByte ()
>   at SerialPortTest.ReadData () [0x00000] 
>   at SerialPortTest.Test () [0x00000] 
>   at SerialPortTest.Main (System.String[] args) [0x00000] 
> 
> I have: openSUSE 11.0 on VMWare WS ACE Edition 6.0.2 hosted on Windows
> Vista
> 
> Mono version is 2.0
> 
> --> In Visual Studio on Windows work fine.
> 
> What is the problem??
> thanks
> 
> 

-- 
View this message in context: http://www.nabble.com/TimeoutException-on-SerialPort-%28mono-2.0%29-tp21026719p21082218.html
Sent from the Mono - General mailing list archive at Nabble.com.



More information about the Mono-list mailing list