Active Topics

 


Reply
Thread Tools
Posts: 20 | Thanked: 16 times | Joined on Jan 2010 @ Norway
#1
Hi,

I am trying to disconnect from the internet using python.

I found that the following following code works from the console:
Code:
dbus-send --system --dest=com.nokia.icd /com/nokia/icd_ui com.nokia.icd_ui.disconnect boolean:true
But i can't figure out how to get this to work from within python, i have tried the following but it won't work.

Code:
import dbus
bus=dbus.SystemBus()
icd_obj=bus.get_object('com.nokia.icd','/com/nokia/icd_ui')
icd=dbus.Interface(icd_obj,"com.nokia.icd_ui")
icd.disconnect(True)
If anybody could help me figure this out it would be greatly appreciated.

Last edited by rcastberg; 2010-05-14 at 08:52. Reason: Changed the subject to include solved
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
Hi,

I can't help but http://talk.maemo.org/showthread.php?t=42588 is along the same lines so you may be able to figure out a solution from that thread.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
Posts: 20 | Thanked: 16 times | Joined on Jan 2010 @ Norway
#3
Thanks a lot,

using the url Mobile Hotspot garage page in the post you sugest i managed to get it working.

Code:
import dbus
bus=dbus.SystemBus()
icd2_obj = bus.get_object('com.nokia.icd2', '/com/nokia/icd2') 
icd2_iface = dbus.Interface(icd2_obj, 'com.nokia.icd2')
icd2_iface.disconnect_req(dbus.UInt32(32768))
Not quite the same call but it looks like it works for disconnecting.
 

The Following User Says Thank You to rcastberg For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 21:00.