thaliproject / thali

Our root repository for all of our projects
MIT License
86 stars 13 forks source link

Finish Wi-Fi Direct binding spec for discovery #165

Closed yaronyg closed 8 years ago

yaronyg commented 9 years ago

Write out how we expect people to perform discovery using Wi-Fi Direct and how to go from discovery to establishing a bluetooth connection.

yaronyg commented 9 years ago

This is a child of #154

obastemur commented 9 years ago

@yaronyg @DrJukka I was playing with WiFi direct on a large phone base and saw it works nice if the two devices are from the same manufacturer. (no matter what the underlying android distro is)

If we get device manufacturer info somehow and see it's matching, it looks like WiFi direct is a good option. Although there are various android device manufacturers, most of the people has devices from top 3-4 manufacturers. It is likely to cross by a person with a device from same manufacturer.

yaronyg commented 9 years ago

Yup, we saw the same thing. When we tested with two Samsung S6s service discovery worked like a house on fire. My guess is that we are going to have take a layered approach.

Layer 1 - BLE - This seems to work regardless of the device types. So for devices that support being a BLE peripheral (read: Lollipop or higher with Bluetooth 4.2 hardware stacks) this "just works" regardless of who made the device.

Layer 2 - BLE Client - Older android devices support being a BLE client but not a BLE peripheral. Since they use older hardware it isn't clear if BLE will work there as well but our suspicion is that it will and so once we test this we will give older phones BLE Client capabilities for discovery. Of course this means they can only discover newer phones and newer phones can't discover them. But this isn't as bad as it sounds because BLE is full duplex so if one phone discovers the other phone then this enables them to both still talk.

Layer 3 - Wi-Fi Peer Discovery - This works on older phones (back to Jelly Bean at least) and seems to work fine when mixing and matching phones from different manufacturers. We don't like it because it's not very battery efficient and it requires more complicated code from us but it is workable and will enable older phones to reliably discover each other.

Layer 4 - Wi-Fi Service Discovery - On older phones from the same manufacturer this does seem to work quite well and is more battery efficient than Layer 3. Since we already have the code for this we should probably throw it in, resource and schedule permitting.

obastemur commented 9 years ago

@yaronyg Sounds good