public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* Exit from software scheduled periodic inquiry on program termination
@ 2009-03-20  0:31 Ilya Rubtsov
  2009-03-20 17:19 ` Ilya Rubtsov
  0 siblings, 1 reply; 2+ messages in thread
From: Ilya Rubtsov @ 2009-03-20  0:31 UTC (permalink / raw)
  To: linux-bluetooth

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?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-20 17:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-20  0:31 Exit from software scheduled periodic inquiry on program termination Ilya Rubtsov
2009-03-20 17:19 ` Ilya Rubtsov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox