Search code examples
androidbluetoothconnectionbluetooth-device-discovery

Android: Behavior of multiple Bluetooth scans from 2 devices at same time


I am trying to perform bluetooth device discovery from 2 Motorola Droid 2 phones at the same time. Each of them see different list of devices. Actaully there are 5 devices around them other than those 2 mobiles. So I am expecting both of them to see all other 5 devices. But, one sees 2 devices and other sees 4 devices. This count varies in different scans. I double checked that all the devices are in discoverable mode.

Please help me understand the behaviour of this discoveries.

Question 1: Is this normal? Having 2 scans at a time, will conflict some how?

Also, if 2 phones discover the same phone lets say "X".

Question 2: Can these 2 phones connect to "X" at a same time?

Actually on phone "X" I am running a bluetooth listener to accept connections. I see inconsistent behavior in this connections (some times one of the phone cannot establish the connection.)

I searched in this forums and few discussions had really helped me a lot to understand the Bluetooth connections. But still I am not completely clear on the above 2 questions.

Thanks in advance for the help.


Solution

  • Question 1: Is this normal? Having 2 scans at a time, will conflict some how?
    

    There can be rare conflicts , but there is enough redundancy built into the scanning procedure that it should not matter. The results you are seeing might be because as part of the scanning for devices the devices also try to establish a short connection and try to retrieve the name, during these times when connection is being established devices stop scanning for short durations and thus could end up not being found.

    Also, if 2 phones discover the same phone lets say "X".
    Question 2: Can these 2 phones connect to "X" at a same time?
    

    No, at the basic lowest level (baseband / radio) it is one procedure at a time , while it is establishing one connection it cannot do anything else. The connection establishment procedure itself is long and involved so it is possible that while the radio & baseband level connection is done and upper host / application level connections are in progress the device can be connected to one device and also scanning for connections from other devices, so at the application level it can seem like 2 things are happening simultaneously.