Signals

Robert Rawlins - Think Blue robert.rawlins at thinkbluemedia.co.uk
Wed Apr 18 03:39:23 EDT 2007


Hello Chaps,

 

I posted about this the other day but I'm still struggling to get any form
of result from it. Basically I have the following piece of code, and
according to its API is produces singals when particular events occur, but i
have no idea how to list for events, I've tried all sorts of combinations
using the signal module but haven't been able to get it working.

 

#!/usr/bin/python

 

import dbus, signal

 

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')

 

adapter.DiscoverDevices()

 

Now here is a copy of the API documentation that lists the signals thrown by
the API, this is the one I'm trying to listen for.

 

        void RemoteDeviceFound(string address, uint32 class, int16 rssi)

 

               This signal will be send every time an inquiry result

               has been found by the service daemon. In general they

               only appear during a device discovery.

 

Basically I'm just looking to run a function that will print those details
to screen. Can anyone help with working out how to listen for this signal?
I'd also like to know how i can keep the application running until I decided
to stop it manually, as the DiscoverDevices() can take a while to complete
and send out several RemoteDeviceFound() signals in that period.

 

Thanks guys

 

Rob

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20070418/28b7dcc8/attachment.html>


More information about the Python-list mailing list