Alan
Fri Oct 31 05:34:33 CST 2003
Robert <anonymous@discussions.microsoft.com> wrote:
> The peer device is an embedded system using the MCP2150
> IrDA controller. I try to transfer 1MB data as fast as
> possible, so it is easy to measure the speed.
>
Well if you are getting a full 9600bps that would indicate that the IrDA
IrLAP connection is being made at a bit rate _above_ 9600bps. Because an
IrDA link is half-duplex and requires quiet time each time it 'turns' and
also due to framing overhead the data raw rate is far less than the raw
IrLAP bit rate.
Its a while since I've looked at datasheet for that chip and how it does
flow control. Are you simply discarding the received data and are always
ready to receive?
However, I've seen reports that that chip is very slow anyway, see
http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&safe=off&threadm=9abb1b1d.0305131332.64f8de3%40posting.google.com&rnum=28&prev=/groups%3Fq%3Dalanjmcf%2Birda%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26safe%3Doff%26scoring%3Dd%26start%3D20%26sa%3DN
I'm not sure whether the "1kb" he reports is truly 1kbps or 1kBps... 1kBps
(8192bps) is close to your 9600bps. He also notes "an engineer at microchip
and he has given me some pointers on how to make the MCP2155 (Irda protocol
chip) run faster ", perhaps you can get the same help.
> But for confirmation I also tried Windows PCs ....
>
Between the PC and the MCP or between the PC and the PPC/CE machine? I
presume the former, what throughput rate did you get then?
> To other IrComm devices I am able to use 115200 baud, so
Erm, between what and what?
Again, when you say, "able to use 115200 baud" do you mean, "I measured an
average throughput of approximately 115200bps when transferring a large
file"?
> the problem is definately on the Pocket PC side! I think
Maybe once you clarify the above I'll be able to follow the thinking that
led to that conclusion.
> this is a bug in the compact framework. The
Ok then, quickly knock up a C program that uses the Winsock interface to see
whether the same behaviour occurs then. What interface are you using on
your PC to connect to the MCP? Winsock with IRLMP_9WIRE_MODE?
What "compact framework" API are you using by the way? IrDAClient? As far
as I can see there is no way to use that class to talk to IrCOMM peers,
there's no way to set IrCOMM mode on it sadly (this is a BIG ommission,
anyone like to complain to Microsoft).
Using IrDAClient to talk with an IrCOMM peer odd things are likely to occur,
on input an extra byte (or bytes) will be received for each TinyTP packet
received, on send, the peer will lose one or more bytes from the beginning
of each packet. Its possible that since the peer is using data bytes as
IrCOMM control data odder things will happen too (setting of control lines,
changing data format etc).
I also can see no way you use .NET's Socket for IrDA either (no support for
undefined socket options nor other sockaddr types), so it would need
PInvoke-ing to Winsock...as far as I can see...
> system.net.irda.dll does not use the IAS ability to
> increase the speed after the discovery mode.
>
IrLAP not IAS, IAS is the database service. You haven't convinced me of
this. Just because the throughput rate you get is less that you hope for it
doesn't mean that the IrLAP connection is not being formed at a high rate.
I've just had a glance at the datasheet and it notes that the very maximum
throughput is 63% of the IrLAP bit rate. This is in section 2.10.2 which is
worth a read.
I'm also pretty sure that the system.net.irda.dll takes no interest in the
bit rate being negotiated, I would imagine its just a thin shim to Winsock
and Winsock takes no interest either. It's down the IrDA stack and the
device driver alone and what rates the peer advertises.
If you have a serial dongle on your PC you can sniff the connection setup
between your PPC and the MCP2150 to see what IrLAP bit rate (and frame size
etc) is negotiated. There a tool "sniffir.exe" in the DDK that can be used
for this, or you can just read the data from the serial port at 9600bps and
hand decode it. :-) (Look for a frame starting with C0 FF 93 followed
immediately by one starting with C0 xx 73, where xx is arbitrary).
>> -----Original Message-----
>> Robert <anonymous@discussions.microsoft.com> wrote:
>>> IrDA connection works fine with the compact framework,
>>> BUT the maximum transfer rate is only 9600 bps!!!
>>>
>> What is the peer device? Windows 2000 etc?
>>
>> How do you know the bit rate is 9600bps? What piece of software is
>> telling you this?
>>
>> Or is it that the connection fails unless you restrict the IrDA
>> device on the PC's max bit rate to 9600bps? Give us a clue. :-)
>>
>>
>>> Does anyone know how to solve this problem??
>>> Where does it come from? system.net.irda.dll? With the
>>> poor documentation available, there is no way to change
>>> the speed.
>>>
>>> Discovery with IrDA will always start with 9600 bps, but
>>> after the connection is established, the IrDA Stack
>>> should increase the speed to the maximum available from
>>> the IrDA Server.
>>>
>>> Can anyone help me?
>>>
--
Alan J. McFarlane
http://homepage.ntlworld.com/alanjmcf/
Please follow-up in the newsgroup for the benefit of all.