Talk:Tutorials/ophoned

From freesmartphone.org
Jump to: navigation, search

InitProtocols is not a valid method

Why does the following code from the tutorial not work? (SHR Testing)

UnknownMethodException: org.freedesktop.DBus.Error.UnknownMethod: Unknown method: InitProtocols is not a valid method

#!/usr/bin/python
import dbus
import gobject

from dbus.mainloop.glib import DBusGMainLoop
DBusGMainLoop(set_as_default=True)

# First, we get the dbus proxy object
bus = dbus.SystemBus()
#gsm = bus.get_object('org.freesmartphone.ogsmd', '/org/freesmartphone/GSM/Device')
phone = bus.get_object('org.freesmartphone.ophoned', '/org/freesmartphone/Phone')

print "Init phone protocols"
phone.InitProtocols()

def on_incoming(call_path):
    print "incoming: %s" % call_path
    call = bus.get_object('org.freesmartphone.ophoned', call_path)
    peer = str(call.GetPeer())
    print "peer = %s" % peer

phone.connect_to_signal('Incoming', on_incoming)

print "starting the main loop"
loop = gobject.MainLoop()
loop.run()

--Nowic 16:11, 21 June 2009 (UTC)

Personal tools