Dear Sirs,
I have upgraded to latest QFE2 (.NET MF 4.2 RTM QFE2 + GHI NETMF v4.1 v4.2 and .NET Gadgeteer Package (RC2 8-24-2012).zip) to get fix the existing SerialPort.Read() timeout problem exsist in QFE1.
(background info: https://netmf.codeplex.com/workitem/1633 )
Please, correct me what should be the correct behaviour of SerialPort.Read (), timeout, available bytes, number of bytes what I actually try to read system in QFE2?
E.g. based on my opinion:
(datas for case study 1.: timeout=5000 ms, actually received bytes in puffer = 20, number of bytes what I want to read: count = 100 in serialPort.Read( buffer, 0, count ) )
When the serialPort _DataReceived() event fired, I use the int numberOfReallyReaded = serialPort.Read( buffer, 0, count ) it must be a blocking function till
I receive the needed number of bytes (according count e.g. 100)
or
till timeout time is not ellapsed (e.g. 5000 ms).
Let me emphasize I sent only 20 bytes to device serialport puffer in my tests intentionally to force the system to wait (block at Read() function) for 5000 ms timeout.
Another say, I used count = 100 intentionally but it will never should happen (never will be 100 bytes in puffer) as I sent only 20 bytes from 3rd party system.
So based on my opinion SerialPort must wait for timeout period (blocking Read() function), and after timeout period it must go to the next program line.
My problem is: serialPort / Read() function in QFE2:
-quit immediately (never wait for timeout if the actual number of bytes in puffer less than count -what number of bytes I want to read)
-neither never drop exception (if number of bytes in puffer less than the count and the timeout ellapsed).
Is there anybody who can explain: how the serialport should work in a quality mode in QFE2?
thanks !
Péter