Re: [Bluez-devel] [PATCH] Make BluetoothClient work on all adapters

Marcel Holtmann
2007-07-25T06:51:04Z

Hi Bastien,

> > > However this includes that we have to monitor if the default adapter
> > > changes or one adapter gets removed while being in the adapter selector
> > > widget or device selector widget.
> >
> > Fair enough, I knew this would be a sticky point. I'm trying to fix it
> > up so that we use the default adapter by default with "NULL" passed as
> > the adapter.
>
> Here goes. This should correctly kill the disco on the old default
> adapter and re-enable it on the new default adapter, when the default
> adapter changes.
>
> If the default adapter changes but we didn't start a discovery using the
> default adapter, then it's up to the application to start/stop it
> anyway.
>
> It will also make all the functions taking an adapter use the default
> adapter when NULL is passed.
>
> We should also kill discovery on all the devices when the object goes
> away, and move the treestore, and dbus connection to the class, rather
> than using statics. But that's for another patch.

when the object goes away, then we can disconnect from the system bus
and kill our D-Bus connection. This means that hcid will detect that our
application is no longer in control and cancel everything that is still
running. Only exception is periodic inquiry, but that is meant to be
like it and we don't have to worry.