List Info

Thread: Listening For Signals




Listening For Signals
country flaguser name
United Kingdom
2007-04-18 03:11:52
 
I'm trying to listen for signals posted by the API, but I'm struggling to get it working properly, here is the code i'm attempting to run at the moment.
 
#!/usr/bin/python
import dbus, signal, time
bus = dbus.SystemBus()
obj = bus.get_object('org.bluez', '/org/bluez')
obj = bus.get_object('org.bluez', '/org/bluez/hci0')
adapter = dbus.Interface(obj, 'org.bluez.Adapter')
def remote_device_found(addr, class_, rssi):
print 'Device Found:', addr
adapter.connect_to_signal('RemoteDeviceFound', remote_device_found)
def main():
adapter.DiscoverDevices()
main()
 
The code runs without error, but it doesn't print the found devices, what am i missing?
 
Thanks guys,
 
Rob


Be one of the first to try Windows Live Mail. Windows Live Mail.
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )