Re: Waiting for a specific device to appear
Re: Waiting for a specific device to appear
- Subject: Re: Waiting for a specific device to appear
- From: "email@hidden" <email@hidden>
- Date: Fri, 6 Jun 2008 02:00:36 +0200
On Jun 6, 2008, at 1:23 AM, Zach Rosen wrote:
a - what is the best / smart way for an application to wait for a
bluetooth device to be in range of the computer and start
interacting with the device ?
The long answer: device 'range detection' is generally discouraged
due to the interference it can cause. When two devices want to
connect, the master device must scan the 2.4GHz range in order to
synchronize frequencies with the slave device. Bluetooth
connections use spectrum hopping to avoid interference with other
2.4GHz devices, but this initial scan for setting up the connection
is like firing a shotgun into the air. A single shot may not do
much, but do it enough and you're going to start hitting things.
Expect decreased wireless reception as well as dropped WiFi and
Bluetooth connections, interference with cordless phones, etc.
The short answer: I've found name requests to cause the 'least'
amount of interference. Don't initiate them AT ALL when a device is
pairing (it will mess up device discovery). Don't initiate more
than one at a time. Don't initiate more than one every 60 seconds.
Okay.
b - what is the status of the IOBluetooth framework on TIger and
Leopard regarding multithreading, is the framework thread safe?
No. Not thread safe. It's best to keep everything on the main
thread. It might be possible to use a single thread instead; this
has been discussed in the past, but i can't remember what the
conclusion was. You might want to search the list.
Okay, I came to the same conclusion when I saw the result on Tiger &
Leopard.
c - what could possibly go wrong in what I've done so that I'm not
able to open and RFCOMMChannel ?
Try moving everything to the main thread.
Okay, I've moved eveything in the main thread, and it is working like
a charm now! Thanks.
Jean-Baptiste LE STANG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden