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 05:59:48 -0700
This is correct. An RFCOMM channel number by itself is not a unique
identifier for the local device. It is a unique identifier for a
connection between the local device and a remote device. In fact
because of the way that the Bluetooth specification adopted the serial
emulation layer (it hides a bit, and uses if for indicating direction),
a RFCOMM channel number does not uniquely ID a connection between a
local device and a remote device. For example: The Mac could open
RFCOMM channel 3 to the phone, and the phone could open RFCOMM channel
3 on the Mac. There are really some more bits there which uniquely ID
those channels so that they are both not channel 3, but they are hidden
in the Bluetooth portion of the RFCOMM specification.
For this reason there is an isIncoming API to determine whether this is
a RFCOMM channel which was opened on another device, or an RFCOMM
channel which another device opened on the Mac.
Given all that, RFCOMM server should be able to handle getting multiple
channel notifications from several remote devices as once. I know that
it's purpose in life when originally developed was not to handle that
case, so I would not be surprised if there were some issues with it
needing logic to separate out the data from each channel and handle it
differently. We will have a look at this for a future release and
clean it up if needed.
-larson
On Sep 2, 2003, at 11:36 AM, Crichlow, Eric wrote:
I am in the process of modifying RFCOMMServer to allow it
accepting connections from multiple clients.
Well, I don't know the first thing about sockets, but I have a
setup
where multiple Bluetooth device can initiate connections to my
application.
To accomplish this all I had to do was set up an incoming channel.
Whenever
a device connects, it comes in on that channel, I have a callback that
gets
called and (according to the Apple guys here) the Bluetooth system
software
does a master-slave switch, leaving the system ready to accept another
incoming connection.
_______________________________________________
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.