Thread (2 messages) read the whole thread 2 messages, 1 author, 2009-03-20

Exit from software scheduled periodic inquiry on program termination

From: Ilya Rubtsov <hidden>
Date: 2009-03-20 00:31:35

Hi!

I need fast and frequent inquiry, so I set DiscoverSchedulerInterval=1 
in /etc/bluetooth/main.conf. Software scheduler works fine. But I have 
problems when I interrupt my program by Ctrl-C. Scheduler doesn't see 
that program was terminated and continues to send Inquiry command every 
11 seconds (in my case), but when I used normal periodic inquiry 
(hardware scheduled) chip automatically exited inquiry mode on program 
termination. So now if I rerun my program and try use adapter I catch 
execution 'Adapter is not ready'.

There is one more problem. If program was terminated and scheduled 
inquiry continues then the Manager.ListAdapters method returns 
duplicated list of adapters:
dbus.Array([dbus.ObjectPath('/org/bluez/7868/hci0'), 
dbus.ObjectPath('/org/bluez/7868/hci1'), 
dbus.ObjectPath('/org/bluez/7868/hci0'), 
dbus.ObjectPath('/org/bluez/7868/hci1')], signature=dbus.Signature('o'))

Then I unplug one dongle and get:
dbus.Array([dbus.ObjectPath('/org/bluez/7868/hci0'), 
dbus.ObjectPath('/org/bluez/7868/hci0')], signature=dbus.Signature('o'))

Then plug that dongle again and get:
dbus.Array([dbus.ObjectPath('/org/bluez/7868/hci0'), 
dbus.ObjectPath('/org/bluez/7868/hci0'), 
dbus.ObjectPath('/org/bluez/7868/hci1')], signature=dbus.Signature('o'))

I asked Vudentz at #bluez about it and he gave me patch - 
http://fpaste.org/paste/6518 . I used it. Now list is not duplicated - 
one bug fixed. But DefaultAdapter() now causes exception 'No such 
adapter' - +1 bug :)

Any ideas?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help