I figured out partially why WiFiDirect wasn't working
The example assumes that there is only 1 other device around and uses discoveredDevices entry 0
I have lots of devices around;
So for the time being I hard coded my real mac addresses and look for them and use that discoveredDevices entry
If Success Then
discoveredDevices = Devices
For i = 0 To discoveredDevices.Size-1
Dim dev As WifiDevice = discoveredDevices.Get(i)
Log($"Device:${dev.Name} ${dev.MacAddress}"$)
If dev.MacAddress.EqualsIgnoreCase("16:---------:e0") Or _ ' Galaxy Tab 7A Mac Addresses hidden for posting
dev.MacAddress.EqualsIgnoreCase("1e:---------:39") Then ' Bobs S20 FE
UseDeviceEntry = i
Exit
End If
Log($"Device:${i} - ${discoveredDevices.Get(i)}"$)
Log(" ")
Next
lblDevicesText = discoveredDevices.Size
Else
lblDevicesText = "0"
End If
When I click Connect the other device shows a message asking to connect.
I reply Yes to the message, after a while the "client failed to connect" message shows up.
But have no idea on how to debug this
When I look at my WiFi connections on the client side I see the peer entry and if I click on it I am asked for a password to connect.
Makes me wonder if there is some type of hidden password I need to provide to connect.
Going to research this after posting
BobVal
PS: I've also added
AddPermission(android.permission.ACCESS_FINE_LOCATION)
to the manifest and runtime permissions to the example.
If I get it working I will convert to B4XPages and upload
Interesting
MyWifiMesh