F
Fabrice MOUSSET
Hi all,
I have developed some Windows CE 6.00 Stream Interface drivers for my
own BSP.
Some of those drivers are very basic, like LEDs or Switch drivers.
I also have developed a lite C# application (C# 2.0) to test my drivers
and I found strange access problem to my Switch driver.
I use FileStream class to read or write to my drivers. For write access
all work fine but for reading I always got an error.
After analyze, I see that the problem is that before reading data from
the driver, the Read() routine try to made a Seek() sequence which is
not supported by the driver!
Here is the code that I am using to read my driver:
public bool GetFrontSwitchState()
{
bool state;
using (FileStream switchFile = new FileStream("SWI1:", FileMode.Open,
FileAccess.Read, FileShare.Read))
{
state = switchFile.ReadByte() == (byte)1;
}
return state;
}
When I look at the "canSeek" property of FileStream object switchFile,
it says "True" but there is no Seek() routine in the Stream Driver !
Is there something wrong in my driver or is it a bug in the FileStream
Class ?
Thanks in advance for any help or suggestion.
Best regards
Fabrice
I have developed some Windows CE 6.00 Stream Interface drivers for my
own BSP.
Some of those drivers are very basic, like LEDs or Switch drivers.
I also have developed a lite C# application (C# 2.0) to test my drivers
and I found strange access problem to my Switch driver.
I use FileStream class to read or write to my drivers. For write access
all work fine but for reading I always got an error.
After analyze, I see that the problem is that before reading data from
the driver, the Read() routine try to made a Seek() sequence which is
not supported by the driver!
Here is the code that I am using to read my driver:
public bool GetFrontSwitchState()
{
bool state;
using (FileStream switchFile = new FileStream("SWI1:", FileMode.Open,
FileAccess.Read, FileShare.Read))
{
state = switchFile.ReadByte() == (byte)1;
}
return state;
}
When I look at the "canSeek" property of FileStream object switchFile,
it says "True" but there is no Seek() routine in the Stream Driver !
Is there something wrong in my driver or is it a bug in the FileStream
Class ?
Thanks in advance for any help or suggestion.
Best regards
Fabrice