R
romain taillandier
Hello group !
I get a strange comportment few for a few days.
My company is developping a RFID Reader embedded in a device (M3
Mobile from mobile compia).
And i am making C# application using it (basic SDK)
the RFID Reader is not the problem, we have other hardware test method
to be sure it is ok, with good timming.
I have create a class :
public class BaseReader : System.IO.Port.SerialPort
this class works very well on Windows CE 5.0, i get a reading time of
an RFID tag about 0.6 sec.
When i use this class on a Windows Mobile 6.1, the code is working as
good as it allways working. But i get à 7 seconds time to read the
RFID tag.
so i get a 10 factor on the time access on the port between CE5 and
WM6.1.
As far as i have allready see such difference between WCE and WM, i
know how to correct it, i use my own Serial Port Class (from CF1.1),
and usually it works good and faster than CF2.0 SerialPort on every
plateform.
But i never implement the ByteToRead method from now (never need it).
And my new BaseReader class use it a lot.
I implement this property, but i allways get 0.
public int BytesToRead
{
get
{
int lpErrors = 0;
if(!ClearCommError(this._handle, ref lpErrors, ref
this.comStat))
throw new Exception("WinIOError()"); // never
go there !
return (int)this.comStat.cbInQue; // Allways return 0;
}
}
this is a standard implementation i found the same every where....
I am trying now to make this code work, with no succes !
But the read works, and when i write a command to my RFID Reader, i
can read the attempting response (no depending what BytesToRead
saying)
the second way (suggested by a friend) is that the RxFIFO of the
serial port is badly configure in registry. then the internal timeout
in the driver is timming up before the fifo is full, so it wait a few
milli second in each of my 64 read command, and i get back the rx
buffer good, but late.
It can explain the time, and may be it can explain that i allready get
0 when trying to get the ByteToRead, because the driver has allready
read the Hard buffer and store the data in a soft buffer (which has
the oversized fifo).
but I don't found nothing about this anywhere
So i have the following questions :
- I suppose it is well known that the System.IO.Port.Serial present
different timming perf depending it is on WCE or WM, where i can found
doc about that ? and workaround ?
- How can i implement the BytesToRead better ? (i need it
fonctionnal )
- how can i configure the RxFIFO size, and/or the internal timeout of
the driver ? (registry ?)
thank you for your help, i can send precision of my problems if
necessary, but i think i have tell everything i can
Romain TAILLANDIER
I get a strange comportment few for a few days.
My company is developping a RFID Reader embedded in a device (M3
Mobile from mobile compia).
And i am making C# application using it (basic SDK)
the RFID Reader is not the problem, we have other hardware test method
to be sure it is ok, with good timming.
I have create a class :
public class BaseReader : System.IO.Port.SerialPort
this class works very well on Windows CE 5.0, i get a reading time of
an RFID tag about 0.6 sec.
When i use this class on a Windows Mobile 6.1, the code is working as
good as it allways working. But i get à 7 seconds time to read the
RFID tag.
so i get a 10 factor on the time access on the port between CE5 and
WM6.1.
As far as i have allready see such difference between WCE and WM, i
know how to correct it, i use my own Serial Port Class (from CF1.1),
and usually it works good and faster than CF2.0 SerialPort on every
plateform.
But i never implement the ByteToRead method from now (never need it).
And my new BaseReader class use it a lot.
I implement this property, but i allways get 0.
public int BytesToRead
{
get
{
int lpErrors = 0;
if(!ClearCommError(this._handle, ref lpErrors, ref
this.comStat))
throw new Exception("WinIOError()"); // never
go there !
return (int)this.comStat.cbInQue; // Allways return 0;
}
}
this is a standard implementation i found the same every where....
I am trying now to make this code work, with no succes !
But the read works, and when i write a command to my RFID Reader, i
can read the attempting response (no depending what BytesToRead
saying)
the second way (suggested by a friend) is that the RxFIFO of the
serial port is badly configure in registry. then the internal timeout
in the driver is timming up before the fifo is full, so it wait a few
milli second in each of my 64 read command, and i get back the rx
buffer good, but late.
It can explain the time, and may be it can explain that i allready get
0 when trying to get the ByteToRead, because the driver has allready
read the Hard buffer and store the data in a soft buffer (which has
the oversized fifo).
but I don't found nothing about this anywhere
So i have the following questions :
- I suppose it is well known that the System.IO.Port.Serial present
different timming perf depending it is on WCE or WM, where i can found
doc about that ? and workaround ?
- How can i implement the BytesToRead better ? (i need it
fonctionnal )
- how can i configure the RxFIFO size, and/or the internal timeout of
the driver ? (registry ?)
thank you for your help, i can send precision of my problems if
necessary, but i think i have tell everything i can
Romain TAILLANDIER