androidbluetoothwifi-directgoogle-nearbygoogle-nearby-connections

Nearby Connections max connected devices - clarification


I was searching what is the max number of connected devices and I came across a post that roughly states:

When using P2P_STAR, the max number of devices is 10 as this topoly uses Wi-Fi hotspots. That is, if you don't have a router.

This makes me ask two questions:

EDIT: I was reading about nearby connections in the Google Play Game Services and in the "Before you begin" section, it tells the user to "Connect multiple Android devices to the same WiFi network with multicast enabled."

Can this be a reference to the usage of an external router in nearby connections?


Solution

  • Device Limits

    BLE shares the same 3~4 real-device limit as Bluetooth. However, if that were not the case, then Nearby Connections is programmed to attempt to upgrade as many devices to the higher bandwidth WiFi connection and any remaining devices will continue to be connected over the lower bandwidth BT connection.

    WiFi LAN

    Nearby Connections will utilize the router if it's available to both devices. During the initial advertise/discover phase, it uses mDNS to scan for other devices on the same WiFi network (a Bluetooth scan will happen concurrently, and results are merged). After the initial connection, if it connected over Bluetooth, it shares the SSID of what WiFi network you're connected over and, if both devices are connected to the same SSID (and are reachable), it'll attempt to use that connection instead of setting up a hotspot (since it's less disruptive). It then enables TDLS so that the devices can communicate directly with each other, instead of hopping messages through the router.

    Disclaimer: I work on Nearby Connections