|Using WifiManager to connect to a network||Toad||2/1/10 5:21 AM|
I am using a Nexus One with 2.1 SDK. I am having problems with a module in my application connecting programmatically to a network/AP. The code snippet that I am using is:
WifiConfiguration wifiConfig = new WifiConfiguration();
Monitoring the network, I see probe requests transmitting from the device, but I do not see an Authentication/Association request to the access point that I specify in the BSSID. Ultimately, I will perform a scan to determine valid AP BSSIDs, but for testing, I simply want to connect to a test AP which is in close proximity to my Nexus One.
I have set the appropriate permissions in my manifest xml and am not seeing any negative log statements from adb.
Any pointers or suggestions with using WifiManager to perform this action would be very appreciated.
Thank you very much!
|Daniel Rolph||2/2/10 12:30 PM||<This message has been deleted.>|
|Re: Using WifiManager to connect to a network||Neil||2/3/10 2:11 AM|
I can't help with your protocol question, but the reason why
specifying the SSID isn't working is because it needs to be a quoted
wifiConfig.SSID = "\"test\"";
> wifiConfig.BSSID = "00:0C:41:F5:B0:08";
> wifiConfig.priority = 1;
> int netId = wifi.addNetwork(wifiConfig);> I am curious about the behavior of the network activity that I am seeing. The N1 is constantly broadcasting Probe Requests. The Access Point is sending out Probe Responses. When I enable the network with the SDK, the N1 sends out a Probe Response with the SSID of the AccessPoint (probably determined from the Probe Response). The N1 then sends out an Association Request to the AP and negotiates the connection. Why can't I initiate an Association Request to the AP prior to receiving the AP Probe Response? Basically, I would like to already have the AP defined in my WifiConfiguration and be sending Association Requests prior to being in range of the AP. Is this possible or am I constrained by the protocol?
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Android Developers" group.
> > To post to this group, send email to android-d...@googlegroups.com
> > To unsubscribe from this group, send email to
> > email@example.com
> > For more options, visit this group at
|Re: [android-developers] Re: Using WifiManager to connect to a network||Daniel Rolph||2/3/10 4:49 AM|
Thanks for the catch on the SSID. Actually, I find that I can only connect when I do not specify the SSID. Documentation on wifi management is a little hard to come by. I am learning the wifi packages and device/driver functionality through trial and error, logging, and network monitoring. I'll eventually get there.