开发者

auto connect to specific wifi access point via python application for Nokia S60

I am new in Python S60. I try to make an easy application, but I have a problem with the setting default access point. Here is the code of the application:

import btsocket
import urllib
import appuifw
ap_names = []
ap_ids = []
ap_list_of_dicts = btsocket.access_points()
for item in ap_list_of_dicts:
   ap_names.append(item['name'])    
   ap_ids.append(item['iapid'])

print "Name:", ap_names[0] // my wifi access point is on index 0 in list
print "ID:", ap_ids[0]
ap = btsocket.access_point(ap_ids[0])
btsocket.set_default_access_point(ap)
ap.start()
print "IP:", ap.ip()
opener = urllib.FancyURLopener({})
f = opener.open("http://example.com/")
f.read()

My problem is that the application still asks me for the selecting of the access point, despite that I set the default AP with btsocket.set_default_access_point(ap). Could you help me, please? Where is the problem? I need to open connection with my wifi access point automatically. My phone is Nokia E51 with Symbian S60 3rd gene开发者_Python百科ration. It is installed python S60 v.2.0.0 on it.

Thanks a lot

Mato

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜