I know the iPhone Bluetooth capabilities won\'t be accessible through the SDK until 3.0, but how long should it take to find devices in the area? Is it dependent on the number
Not sure what the API will let you do but the Bluetooth Host Controller Interface (HCI) command underlying this is the 'Inquiry Command'
This will let you inquire about devices either for a fixed time and/or a fixed number of responses.
I'm a Bluetooth neophyte, not an expert but...
To get at least 1 response from a Bluetooth device that is in a low power mode takes 1.28 seconds, so inquiry time is in multiples of that period up to a maximum of 61.44 seconds (48 periods), so the time range is 1 (1.28 seconds) to 48 (61.44 seconds).
There might be several devices that could respond in a single 1.28 second period though.
You can also specify the number of responses you will accept (1..255) or 0 for unlimited e.g. until the time runs out.
You can also cancel an inquiry, if you found a particular device you were looking for.
Unscientific test from my desk using a CSR bluetooth chip with Bluetooth 2.1 +EDR firmware running inquiry on the chip with debug output via the chip UART. Ran each inquiry 10 times and took an average of the results:
I say 'unique', actually the results repeated a lot of the same addresses over and over, this may be implementation dependent though and the Apple API may only return unique addresses.
However, this is not representative of the 'real world' as most of the Bluetooth Devices around here (my office) are not in a low power mode. I guess, I could filter out PCs, laptops and test kit by Class of Device. That would get mobile phones, headsets that were discoverable etc...
Inquiry can also be combined with RSSI to get the the devices with the strongest signal but they may not necessarily be the closest.
For your scenario you might want to do an inquiry bases on time and number of devices e.g 4 * 1.28 seconds or 10 devices.
To summarise: The shortest time you can do an inquiry for is 1.28 seconds and that could get 10+/-? devices in the area IF they are awake and near by.
If you've got a saturated Bluetooth environment or (a microwave oven going in the same room) it could take longer to find all the devices within range.
I know this is an old question, but I thought I might add something for anyone who finds this question later.
As Simon Peverett mentions, device discovery is performed by an underlying "Inquiry Command" that is carried out by the Bluetooth Host Controller Interface. In the Bluetooth spec V4.0, Volume 2, Part E, Section 6.1.4, the spec says:
When general inquiry is initiated by a Bluetooth device, the INQUIRY state shall last TGAP(100) or longer, unless the inquirer collects enough responses and determines to abort the INQUIRY state earlier.
Elsewhere, TGAP(100) is explained to be 10.24 seconds and is described as the recommended value for the time span that a Bluetooth device performs device discovery.
In other words, a good baseline for the minimum amount of time to perform an inquiry is 10.24 seconds, or 8 of the 1.28 second periods that the Inquiry Command measures time by.