You Are Here:

Community: Developer Discussion Boards

#1 Old Setting the default AP with WiFi: problem with solution in the documentation - 2009-01-23, 18:31

Join Date: Nov 2008
Posts: 7
mircomusolesi
Offline
Registered User
Hi all,

I tried the solution described in the documentation to set the default WiFi AP.

I used the following code:

apid = socket.select_access_point()
apo = socket.access_point(apid)
socket.set_default_access_point(apo)
apo.start()
self.phoneIp = apo.ip()


This triggers a window "Default access point" with a list of the available APs. Then a confirmation window about the fact that I am creating a default AP in offline mode (I am not using a SIM at the moment) is displayed.

But then when I called the socket constructor, a new window for the selection of the AP is again displayed, this time the standard one with the title "Search access point" (no confirmation is needed about the "offline status").

The code for retrieving the access point is in the constructor of the object. The object starts a thread where the socket is created. If I put the code in the thread, the phone simply freezes.

What is the best way of setting the standard WiFi AP?

Any help is really appreciated.

Thanks,
Mirco
Reply With Quote

#2 Old Re: Setting the default AP with WiFi: problem with solution in the documentation - 2009-01-23, 20:23

Join Date: Nov 2007
Posts: 319
Location: Sertaozinho/Brazil
Send a message via MSN to marcelobarrosalmeida Send a message via Skype™ to marcelobarrosalmeida
marcelobarrosalmeida's Avatar
marcelobarrosalmeida
Offline
Forum Nokia Champion
I decided to use my own access point dialog, even loosing the "WiFi Search" feature. Then, I set the default access point and no questions are done anymore.

Code:
from socket import select_access_point, access_point, access_points, set_default_access_point
from appuifw import *

def sel_access_point():
    """ Select the default access point. Return True if the selection was
        done or False if not
    """
    aps = access_points()
    if not aps:
        note(u"Could't find any access point.","error")
        return False
    
    ap_labels = map( lambda x: x['name'], aps )
    item = popup_menu( ap_labels, u"Access points:" )
    if item is None:
        note(u"At least one access point is required.","error")
        return False
    
    apo = access_point( aps[item]['iapid'] )
    set_default_access_point( apo )
    
    return True


Marcelo Barros
Nokia E71, N800, N95 and XM 5800
http://www.croozeus.com
http://wordmobi.wordpress.com
http://jedizone.wordpress.com
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
VoIP - OMA provisioning Setting, CODEC Problem xweekend VoIP 10 2009-05-07 10:47
Problem with Skin enabling - disabling and Setting List in S60 sauvikds Series 40 & S60 Platform Feedback 6 2008-08-23 15:29
Problem with Skin enabling - disabling and Setting List in S60 sauvikds General Discussion 1 2008-08-21 13:44
Problem with Setting of mobile in toolkit 3.0 jybasle General Browsing 2 2005-10-10 16:48
solution: S60 application icon problem Nokia_Archive Symbian Tools & SDKs 0 2002-06-03 03:43

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia