Re: RFCOMMServer: how to accept multiple connections?
Re: RFCOMMServer: how to accept multiple connections?
- Subject: Re: RFCOMMServer: how to accept multiple connections?
- From: Michael Larson <email@hidden>
- Date: Thu, 4 Sep 2003 11:18:59 -0700
On Sep 4, 2003, at 10:51 AM, Crichlow, Eric wrote:
Well, we have multiple Bluetooth tablets initiating connections to
the
Mac. There seems to sometimes be minor problems when we initiate
multiple
connections simultaneously. Sometimes none of the connections succeed,
other
times most or all of them do. But in general it seems to work quite
well. At
worst we just have to initiate the connections one at a time.
The only real problem comes in trying to get 7 devices connected at
once. The 7th, and sometimes even the 6th device seems to have a lot of
trouble connecting.
This is likely due to a limitation in the Bluetooth baseband. You
could try bumping up the page timeout value for your connection
attempts to the Mac, but there is no way to know at the start how many
devices which the computer you are connecting to already has.
This will likely all come down to a basic scheduling problem - When you
are not doing anything you can listen for longer, and the more you do
(active connections), the less time you have to listen for, so the
probability of success drops.
The sequence of events for creating a connection with a longer page
timeout is unfortunately more complex from a Bluetooth specification
point of view. The setting for the page timeout is a global value, so
you if you want to keep a short default all the time and just bump it
up for a single connection attempt you will need to bump it up for the
connection attempt you care about and bump it down afterwards.
The WritePageTimeout HCI command (HCI_Write_Page_Timeout) can be used.
As a test, if you double this, you should see fewer failed connections
from the device side. There is not currently an option on the Mac side
to control this value, but this is something we are considering for a
future API release. This should not affect you for this issue however,
as you need to bump this value up on the tablet side for it to take
effect when the tablet is connecting. You may want to consider bumping
this value up to a larger value by default on your device, or just
consider bumping it up for any connection reattempt if the default
value did not succeed - it really depends on how many computers the
device may want to connect to since a larger page timeout value means
longer latency for determining that a connection could not be made, but
a larger accuracy of connecting to a loaded computer.
-larson
_______________________________________________
bluetooth-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/bluetooth-dev
Do not post admin requests to the list. They will be ignored.