View Single Post
Posts: 291 | Thanked: 134 times | Joined on Dec 2009 @ North-west, UK
#528
Apparently, this should work, but I get an unsupported method type error (http://talk.maemo.org/showthread.php...366#post915366).

import dbus
self.bus = dbus.SystemBus();
self.icd2_obj = self.bus.get_object('com.nokia.icd2', '/com/nokia/icd2')
self.icd2_obj.connect_to_signal('state_sig', self.icd2_state_listener, 'com.nokia.icd2', byte_arrays=True)
self.icd2_iface = dbus.Interface(self.icd2_obj, 'com.nokia.icd2')
self.icd2_iface.connect_req(dbus.UInt32(1))#ICD_CO NNECTION_FLAG_UI_EVENT(0x8000)

def icd2_state_listener(self, *args):
print "icd2_state_listener got args:\n";
print args


There are some great guys on http://talk.maemo.org/showthread.php?t=42588, more docs on DBUS are http://dbus.freedesktop.org/doc/dbus.../tutorial.html and the various calls and signals you get back are here http://wiki.maemo.org/Documentation/...#D-Bus_signals should you need 'em. For instance there is a 'show_conn_dlg' you could call if connect_req timesout (it puts up a dialogue).
__________________
Go on, press the 'thanks' link, you know you want to

Last edited by tomchiverton; 2011-01-09 at 01:04.
 

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