ARGH ! I like a good challenge but I'm getting frustrated.
I'm having problems disconnecting from one WiFi network and connecting to another.
In trying the Disconnect method, this returns true, but reading the .SSID continues to return the same SSID that should now be disconnected.
Then in calling bSuccess = WifiScanner.connectToAP(EntryNumber) I get an error.
| java.lang.NullPointerException: Attempt to invoke virtual
| method 'boolean java.lang.String.equals(java.lang.Object)'
| on a null object reference
I have of course verified the EntryNumber is correct ( by reading WiFiCap( EntryNumber)
Here is are some details.
Subroutine 1
MLWiFi.EnableWiFi ( True)
' loop waiting for isWiFiConnected = True
MLScan.startScan
Subroutine 2 ( Called from ScanDone)
Dim DesiredSSID as string = ( whatever the desired SSID is )
MLScan.updateWiFiList
if not ( MLWiFi.SSID = desiredSSID ) then
' If false I loop through .Wifis to find entry number
' this is successful, I get the desired entry number
' and I verify this looking at .WifiCap
bSuccess = WifiScanner.Disconnect
log (bSuccess) ' This returns success
' *** BUT Reading Wifi.SSID still gives the disconnected SSID
bSuccess = WifiScanner.connectToAP(EntryNumber)
This call generates Debug output
| Results SSID = "linksys"
| Stored.ssid = "attwifi" Searched ssid = "linksys"
| Stored.ssid = "DIRECT-4D-HP OfficeJet Pro 6960" Searched ssid = "linksys"
| Stored.ssid = "BAFB60" Searched ssid = "linksys"
| Stored.ssid = "HOME 2" Searched ssid = "linksys"
| Stored.ssid = "5BoroGreen" Searched ssid = "linksys"
| Stored.ssid = "DIRECT-8CED802E" Searched ssid = "linksys"
| Stored.ssid = "DIRECT-70-HP OfficeJet 250" Searched ssid = "linksys"
| Stored.ssid = "linksys" Searched ssid = "linksys"
| java.lang.NullPointerException: Attempt to invoke virtual
method 'boolean java.lang.String.equals(java.lang.Object)'
on a null object reference
and then returns false
SSID still returns the originally connected SSID