5

I want to disconnect from a wifi direct group after establishing a connection. I just want to move out silently without interrupting other clients that are already in connection with the Group owner.

I use manager.Connect() method to establish a connection. But didnt see any methods to disconnect. Only other option i saw is manager.removeGroup(), but I guess this will remove the entire group and interrupt the existing network connection.

How can I do this properly?

Thanks

Zach
  • 9,989
  • 19
  • 70
  • 107
  • 1
    If you call it from the client side, it will no have effect on the owner, and other clients. Also here are some interesting thread on how to delete remembered groups and call hidden functions for the WifiP2pManager. http://stackoverflow.com/questions/15152817/can-i-change-the-group-owner-in-a-persistent-group-in-wi-fi-direct/26242221#26242221 – Sebastian Corradi Jan 04 '17 at 14:18

2 Answers2

3

The first parameter of the function removeGroup() is a channel. So I think if this is initiated by a client, only the channel between the client and group owner will be disconnected.

Kan
  • 133
  • 6
-2
 manager.cancelConnect(channel, null);
László Magyar
  • 355
  • 1
  • 16