Open jorisw opened 8 years ago
The behavior seems to be different in 0.2.10
. There, connectNetwork
properly calls the error
callback, but the error message is empty, not allowing me to distinguish authentication failed from connection failed.
I'm working on an actual fix for this issue but it needs further testing, at least for WPA networks. The idea is Android at any given time lets you access the WPA supplicant state. When entering a wrong network key the supplicate state should attempt to handshake and then disconnect.
Thanks for bearing with me on this. It's a pretty huge issue right now but not the easiest to fix.
@hoerresb any update on this, I too find myself wanting to know whether or not I have actually successfully connected, or otherwise, when I have failed to do so, after calling connectNetwork...
@hoerresb Please can we get some form of an update regarding this. The success callback should only be triggered if the network specified was successfully connected to and not if the plugin just worked. It is really annoying having to implement a workaround. I am using version 0.2.11 (WifiWizard) and the Android version seems to be irrelevant.
For those interested I implement a wait of 5 seconds in the success callback which then compares the currently connected SSID with the specified one that was to be connected to. If they match, I assume the connection has worked and move the user onto the next stage and if they don't, I ask them to re-connect.
When I call
WifiWizard.connectNetwork()
, it fires thesuccess
callback even if I add a random network that's not mine, with a random passphrase. Running0.2.11
on Android4.1.1
. My code: