1

If I have a device A,B,C and D connected in a group and let suppose that A is the group owner.Any new peer let suppose E came up and not in the range of A(group owner) but in the range of any of the B,C and D.

  • Can E connect to B,C or D and eventually join the group?

Actually my goal is to send the message to all the peers who are in the range, is there any other way around to connect to all the peers in the range communicate with them and disconnect? Please help...

Talib
  • 1,134
  • 5
  • 31
  • 58
  • https://play.google.com/store/search?q=kouchat does something similar to what you need except that it has no "range". Anyone that has the app installed can connect, chat and disconnect at will. – VJ Vélan Solutions Dec 09 '13 at 06:30

1 Answers1

5

It would be impossible to do that using only WiFi-Direct. It sounds like you are looking to create a mobile ad-hoc network.

Here are some libraries for ad-hoc networks for Android that you could use:

The Serval Project

The SPAN Project

Commotion Wireless

Why isn't it possible with WiFi Direct?

WiFi-Direct only supports one-to-many connections. You must be within range of A to join the group, by the nature of WiFi-Direct. In WiFi-Direct, the group owner acts as an access point, and the group clients do not act as access points, thus, you would be unable to "connect" to any of the clients.

You can think of the owner, A, as an impromptu "router" that everyone else can connect to. If you look at the ip addresses of the phones in the WiFi-Direct network, you'll see they reflect this relationship.

  • A -- 192.168.1.1
  • B -- 192.168.1.54
  • C -- 192.168.1.15
  • D -- 192.168.1.34

Android Wifi direct multiple connection ad-hoc

Community
  • 1
  • 1
Cypress Frankenfeld
  • 2,317
  • 2
  • 28
  • 40