2007-04-18 08:11:52

by Robert Rawlins

[permalink] [raw]
Subject: [Bluez-users] Listening For Signals

Hello Guys,

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
_________________________________________________________________
Try Live.com: where your online world comes together - with news, sports, weather, and much more.
http://www.live.com/getstarted


Attachments:
(No filename) (286.00 B)
(No filename) (164.00 B)
Download all attachments