I am developing an Android WiFiP2P application and attempting to create a WiFiP2P group.
I have multiple android devices as follows:-
Nexus 7 - Android 6.0.1
Nexus 9 - Android 7.1.1
Samsung Tablet - Android 4.4.1
Pixel - Android 8.0.0
Currently my application is not reliable and succeeds in establishing a connection approx 50% of the time.
I can connect any combination of Pixel XL, Nexus 7 & 9 with no issues most of the time. They automatically connect and the majority of the time I do not see any dialogs asking me to accept a connection invite.
However when I attempt to also connect to the Samsung Tablet the connection almost always fails. The Samsung always displays a Dialog asking if I wish to connect and sometimes I get the following error message in the dialog:-
Failed to connect via wi-fi direct. other device is connected to the ap via a different channel.
If I power off all the devices. Restart them they start to work as expected (for a short period).
What I would like to know is
a). What causes the above "Failed to connect via wi-fi...." message on my Samsung Tablet?
b). Why do my other devices mostly automatically connect and do not display a dialog asking if I want to accept the connection invite?
NOTE: The intermittent Dialog gives a very poor user experience within my app.
c). Is there anyway to re initialise the WiFi Hardware on each device (e.g. obtain the same state a manually power off/restart of the entire device)?